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

Site News: Blast from the Past - One Year Ago in PHP

Andrew Podner: NPATH Complexity Demystified

Community News: Packagist Latest Releases for 10.25.2014

Site News: Popular Posts for the Week of 11.30.2012

Community News: Packagist Latest Releases for 02.15.2013


Community Events





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


package list release framework laravel zendserver language symfony opinion tips update introduction series library deployment interview install community api podcast

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