2011-08-16 11:38:58 +00:00
<?xml version="1.0" encoding="UTF-8"?>
2009-07-11 08:59:47 +00:00
<!-- $Revision$ -->
2008-05-12 00:28:53 +00:00
2008-11-15 17:21:02 +00:00
<part xml:id= "spl.datastructures" xmlns= "http://docbook.org/ns/docbook" xmlns:xlink= "http://www.w3.org/1999/xlink" >
2008-05-12 00:28:53 +00:00
2009-10-07 21:19:36 +00:00
&spl.datastructures.intro.title;
2008-05-12 00:28:53 +00:00
2008-11-15 17:21:02 +00:00
<partintro >
2008-05-12 00:28:53 +00:00
<para >
2008-11-14 20:20:38 +00:00
SPL provides a set of standard datastructures. They are grouped here by their
2008-05-13 21:17:36 +00:00
underlying implementation which usually defines their general field of
application.
2008-05-12 00:28:53 +00:00
</para>
2008-11-15 17:21:02 +00:00
<section >
2008-05-13 21:17:36 +00:00
<title > Doubly Linked Lists</title>
<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.
</para>
<itemizedlist >
<listitem >
<simpara > <classname > SplDoublyLinkedList</classname> </simpara>
<itemizedlist >
<listitem > <simpara > <classname > SplStack</classname> </simpara> </listitem>
<listitem > <simpara > <classname > SplQueue</classname> </simpara> </listitem>
</itemizedlist>
</listitem>
</itemizedlist>
2008-11-15 17:21:02 +00:00
</section>
<section >
2008-05-13 21:17:36 +00:00
<title > Heaps</title>
<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.
</para>
<itemizedlist >
<listitem >
<simpara > <classname > SplHeap</classname> </simpara>
<itemizedlist >
<listitem > <simpara > <classname > SplMaxHeap</classname> </simpara> </listitem>
<listitem > <simpara > <classname > SplMinHeap</classname> </simpara> </listitem>
</itemizedlist>
</listitem>
<listitem >
<simpara > <classname > SplPriorityQueue</classname> </simpara>
</listitem>
</itemizedlist>
2008-11-15 17:21:02 +00:00
</section>
2009-04-11 21:04:53 +00:00
<section >
<title > Arrays</title>
<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.
</para>
<itemizedlist >
<listitem >
<simpara > <classname > SplFixedArray</classname> </simpara>
</listitem>
</itemizedlist>
</section>
2009-04-13 11:01:29 +00:00
<section >
<title > Map</title>
<para >
2009-10-03 21:53:15 +00:00
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.
2009-04-13 11:01:29 +00:00
</para>
<itemizedlist >
<listitem >
<simpara > <classname > SplObjectStorage</classname> </simpara>
</listitem>
</itemizedlist>
</section>
2008-11-15 17:21:02 +00:00
</partintro>
&reference.spl.spldoublylinkedlist;
&reference.spl.splstack;
&reference.spl.splqueue;
&reference.spl.splheap;
&reference.spl.splmaxheap;
&reference.spl.splminheap;
&reference.spl.splpriorityqueue;
2009-04-11 21:04:53 +00:00
&reference.spl.splfixedarray;
2009-04-13 11:01:29 +00:00
&reference.spl.splobjectstorage;
2009-04-11 21:04:53 +00:00
2008-11-15 17:21:02 +00:00
</part>
2008-05-12 00:28:53 +00:00
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
2009-09-25 07:04:39 +00:00
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
2008-05-12 00:28:53 +00:00
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
2008-11-15 17:21:02 +00:00