<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Datastructures</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="spl.constants.html">Predefined Constants</a></div> <div class="next" style="text-align: right; float: right;"><a href="class.spldoublylinkedlist.html">SplDoublyLinkedList</a></div> <div class="up"><a href="book.spl.html">SPL</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="spl.datastructures" class="part"> <h1>Datastructures</h1> <h2>Table of Contents</h2><ul class="chunklist chunklist_part"><li><a href="class.spldoublylinkedlist.html">SplDoublyLinkedList</a></li><li><a href="class.splstack.html">SplStack</a></li><li><a href="class.splqueue.html">SplQueue</a></li><li><a href="class.splheap.html">SplHeap</a></li><li><a href="class.splmaxheap.html">SplMaxHeap</a></li><li><a href="class.splminheap.html">SplMinHeap</a></li><li><a href="class.splpriorityqueue.html">SplPriorityQueue</a></li><li><a href="class.splfixedarray.html">SplFixedArray</a></li><li><a href="class.splobjectstorage.html">SplObjectStorage</a></li></ul> <div class="partintro"> <p class="para"> SPL provides a set of standard datastructures. They are grouped here by their underlying implementation which usually defines their general field of application. </p> <div class="section"> <h2 class="title">Doubly Linked Lists</h2> <p class="para"> A Doubly Linked List (DLL) is a list of nodes linked in both directions to each others. Iterator's operations, access to both ends, addition or removal of nodes have a cost of O(1) when the underlying structure is a DLL. It hence provides a decent implementation for stacks and queues. </p> <ul class="itemizedlist"> <li class="listitem"> <span class="simpara"><a href="class.spldoublylinkedlist.html" class="classname">SplDoublyLinkedList</a></span> <ul class="itemizedlist"> <li class="listitem"><span class="simpara"><a href="class.splstack.html" class="classname">SplStack</a></span></li> <li class="listitem"><span class="simpara"><a href="class.splqueue.html" class="classname">SplQueue</a></span></li> </ul> </li> </ul> </div> <div class="section"> <h2 class="title">Heaps</h2> <p class="para"> Heaps are tree-like structures that follow the heap-property: each node is greater than or equal to its children, when compared using the implemented compare method which is global to the heap. </p> <ul class="itemizedlist"> <li class="listitem"> <span class="simpara"><a href="class.splheap.html" class="classname">SplHeap</a></span> <ul class="itemizedlist"> <li class="listitem"><span class="simpara"><a href="class.splmaxheap.html" class="classname">SplMaxHeap</a></span></li> <li class="listitem"><span class="simpara"><a href="class.splminheap.html" class="classname">SplMinHeap</a></span></li> </ul> </li> <li class="listitem"> <span class="simpara"><a href="class.splpriorityqueue.html" class="classname">SplPriorityQueue</a></span> </li> </ul> </div> <div class="section"> <h2 class="title">Arrays</h2> <p class="para"> Arrays are structures that store the data in a continuous way, accessible via indexes. Don't confuse them with PHP arrays: PHP arrays are in fact implemented as ordered hashtables. </p> <ul class="itemizedlist"> <li class="listitem"> <span class="simpara"><a href="class.splfixedarray.html" class="classname">SplFixedArray</a></span> </li> </ul> </div> <div class="section"> <h2 class="title">Map</h2> <p class="para"> A map is a datastructure holding key-value pairs. PHP arrays can be seen as maps from integers/strings to values. SPL provides a map from objects to data. This map can also be used as an object set. </p> <ul class="itemizedlist"> <li class="listitem"> <span class="simpara"><a href="class.splobjectstorage.html" class="classname">SplObjectStorage</a></span> </li> </ul> </div> </div> </div> <hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="spl.constants.html">Predefined Constants</a></div> <div class="next" style="text-align: right; float: right;"><a href="class.spldoublylinkedlist.html">SplDoublyLinkedList</a></div> <div class="up"><a href="book.spl.html">SPL</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>