News Feed
Jobs Feed
Sections




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

PHPMaster.com:
Data Structures for PHP Devs Heaps
July 23, 2013 @ 11:10:17

PHPMaster.com has posted the third part of their "Data Structures for PHP Devs" series today, this time focusing on heaps. Heaps are a method for organizing a parent/child relationship that makes it easier to work with.

In past couple articles I've introduced you to three basic data structures: stack, queue, and tree. In this article I'll introduce you to another abstract data type that is closely related: heap. Heaps are specialized tree-like data structures which satisfy the heap property - the node value (key) of any parent is always ordered with respect to its child node values across the entire tree.

He starts off by explaining what the different types of heaps are - maxheap, minheap and (a special instance) a Priority Queue. He talks about the operations available to heaps and starts off with a binary maxheap implementation using arrays. He also mentions some of the functionality that the SPL already provides for this sort of thing - SplMaxHeap, SplMinHeap and the SplPriorityQueue.

0 comments voice your opinion now!
data structure heap tutorial series spl priority queue

Link: http://phpmaster.com/data-structures-3

blog comments powered by Disqus

Similar Posts

Matthew Turland's Blog: New SPL Features in PHP 5.3 Webcast Slides

HowTo Forge: Installing The PHP-MSSQL Module On CentOS 5.0

DevShed: Handling Cookies and File Data with the Factory Pattern in PHP 5

Thomas Weinart: What Iterators Can Do For You

Gary Hokin: An Introduction to Zend Framework 2 for the Zend Framework 1 Developer - Part 1


Community Events











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


component hack introduction install security project release application performance database package symfony2 framework unittest example podcast composer hhvm language facebook

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