News Feed
Sections




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

DevShed:
Collections and Sorting Continued
April 05, 2006 @ 07:13:17

Previously from DevShed, they started a series on collections and sorting in PHP. Today, they've posted part two of the series that builds on that and looks at sorting algorithm examples.

This article will examine the primary sorting algorithms with code examples, and some empirical data regarding how they perform in relation to one another, as well as the size of the data set in question.

We will also create a function to fill up our collection with random data in order to test the sort algorithms with a sufficiently large data set. The sort algorithms listed above are the ones that every computer science student learns in college and are the primary sort algorithms found in real-world applications.

The sorting styles they cover include: bubble sort, heap sort, merge sort, quick sort, and shell sort. For each, they provide the code, making it a simple matter of cut and paste to make it work in your script. There's not a whole lot of documentation going along with the code in this article, but the sorting code is simple enough to understand without it.

0 comments voice your opinion now!
collections sorting bubble heap merge quick selection shell collections sorting bubble heap merge quick selection shell


blog comments powered by Disqus

Similar Posts

Hardened-PHP Project: PHP HTML Entity Encoder Heap Overflow Vulnerability

Gustav Eklundh' sBlog: Search Methods in PHP

PHPMaster.com: Data Structures for PHP Devs: Heaps

Tobias Schlitt's Blog: PHPUGDO proudly presents: The PHP Weekender

Bill Staples' Blog: Quick Install of the World’s Most Popular Web Applications on IIS7


Community Events





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


list conference version interview composer release symfony framework series tool security community language laravel voicesoftheelephpant opinion library artisanfiles introduction podcast

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