News Feed
Sections




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

Freek Lijten's Blog:
Expressing algorithm complexity the big O notation explained
August 04, 2011 @ 11:28:29

Freek Lijten has put together a new post to his blog looking at a method for showing how complex an algorithm is without having to get too deep into how it works - the big O notation (with examples written in PHP).

I'd like to share a topic today which was re-introduced to me by a lightningtalk of a colleague of mine. His talk was on the "big O notation". The big O notation is a tool you can use to express the order of complexity of an algorithm. It is useful because it lets you express the order of complexity of an algorithm without taking a lot of time profiling or researching the underlying algorithm. In other words: it gives you a quick way to gain an understanding of what might be wrong (or right) with a specific algorithm.

He introduces the notation as the result of a series of steps needed to solve a problem (ex. 2+2 is less complex than 2+2+2). He illustrates with PHP examples that show adding complexity to a class, adding sets of numbers, looping to find needles in haystacks and finding duplicates in an array of strings. Each of these expand on the theory and show more complexity as the article progresses.

0 comments voice your opinion now!
algorithm complexity explanation bigo notation


blog comments powered by Disqus

Similar Posts

Community News: Latest Releases from PHPClasses.org

Community News: Packagist Latest Releases for 12.24.2013

Community News: Latest PECL Releases for 01.10.2012

Community News: Packagist Latest Releases for 02.02.2013

Community News: Latest PECL Releases for 10.30.2012


Community Events





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


language developer laravel code application podcast list tips framework zendserver series api release introduction community threedevsandamaybe conference development deployment interview

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