News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Time Complexity of Algorithms
May 14, 2014 @ 12:25:37

The SitePoint PHP blog has a recent post looking at time complexity in the algorithms you develop in your PHP applications and how that relates to "Big O notation". Big O notation is simply a way of expressing complexity and performance of a method in a less subjective way than "it's faster than.."

If you are a web developer or a programmer in general, you have most likely written algorithms for various tasks. [...] One specification of an algorithm is its correctness. You will probably assume that your algorithm works after testing it out a few times. However, if you can mathematically prove that your algorithm will work as expected for every input value possible, this is a huge bonus. I will not go further in to that subject in this writing. Another specification is its efficiency: how does the computing time relate to the amount of input? Is it a linear relation? Does computing time rise exponentially for the doubling of input? That's what this article will be about.

He starts by talking about the concept of "time complexity" and how it relates to the overall efficiency of the algorithm. He then gets into the definition and examples of Big O notation, including code showing O(n) and O(n2) methods. He talks some about inefficient and efficient algorithms and follows with a refactoring example of moving from one to the other.

0 comments voice your opinion now!
complexity algorithm bigo notation mathematics time tutorial

Link: http://www.sitepoint.com/time-complexity-algorithms/

blog comments powered by Disqus

Similar Posts

BobCares.com: Deploying libcURL with PHP

IBM developerWorks: Introduction to MVC programming with Agavi (Parts 4 & 5)

Bhaskar Karambelkar\'s Blog: Prototyping LAMP with WAMP

Pádraic Brady's Blog: The Factory and Abstract Factory patterns in PHP

MT-Soft Blog: Creating a secure PHP production environment from Source Code


Community Events

Don't see your event here?
Let us know!


introduction framework library release opinion voicesoftheelephpant version symfony2 conference extension interview community laravel api install example php7 performance podcast series

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework