After using PHP for a while now, I've noticed that not all PHP built in functions as fast as expected. Consider the below two possible implementations of a function that finds if a number is prime using a cached array of primes.
Ccna final exam - java, php, javascript, ios, cshap all in one. This is a collaboratively edited question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Showing posts with label big-o. Show all posts
Showing posts with label big-o. Show all posts
Friday, June 8, 2012
List of Big-O for PHP functions
Tags
algorithm,
arrays,
big-o,
performance,
php,
Tips For Programmer
Wednesday, May 9, 2012
array_unique vs array_flip
If I had an array of signed integers e.g:
Array
(
[0] => -3
[1] => 1
[2] => 2
[3] => 3
[4] => 3
)
Sunday, March 11, 2012
Why isn"t LinkedList.Clear() O(1)
I was assuming LinkedList.Clear() was O(1) on a project I'm working on, as I used a LinkedList to drain a BlockingQueue in my consumer that needs high throughput, clearing and reusing the LinkedList afterwards.
Subscribe to:
Posts (Atom)