Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions reference/ds/book.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,20 @@
<preface xml:id="intro.ds">
&reftitle.intro;
<para>
Efficient data structures for PHP 7, provided as an alternative to the &array;.
</para>
<para>
See <link xlink:href="&url.blog.data.structures;">this blog post</link>
for benchmarks, discussion and frequently asked questions.
Efficient data structures for PHP, provided as an alternative to the &array;.
</para>
</preface>

&reference.ds.setup;
&reference.ds.examples;

&reference.ds.ds.collection;
&reference.ds.ds.hashable;

&reference.ds.ds.sequence;
&reference.ds.ds.vector;
&reference.ds.ds.deque;
&reference.ds.ds.key;

&reference.ds.ds.seq;
&reference.ds.ds.map;
&reference.ds.ds.pair;
&reference.ds.ds.set;
&reference.ds.ds.stack;
&reference.ds.ds.queue;
&reference.ds.ds.priorityqueue;
&reference.ds.ds.heap;

</book>

Expand Down
107 changes: 0 additions & 107 deletions reference/ds/ds.collection.xml

This file was deleted.

75 changes: 0 additions & 75 deletions reference/ds/ds.hashable.xml

This file was deleted.

165 changes: 165 additions & 0 deletions reference/ds/ds.heap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->

<reference xml:id="class.ds-heap" role="class" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">

<title>The Heap class</title>
<titleabbrev>Ds\Heap</titleabbrev>

<partintro>

<!-- {{{ Ds\Heap intro -->
<section xml:id="ds-heap.intro">
&reftitle.intro;
<para>
A Heap is a tree-based data structure in which the value at the top of the
heap is determined by a configurable comparator. By default, when no comparator
is provided, the heap behaves as a max-heap using standard comparison.
</para>
<para>
Replaces <classname>Ds\PriorityQueue</classname> from v1, providing more
flexibility through an optional callable comparator that can be passed to
the constructor.
</para>
<note>
<para>
Iterating over a Heap is destructive, equivalent to successive pop
operations until the heap is empty. The iterator operates on an internal
copy, so the original heap is not modified by foreach.
</para>
</note>

<para>
<table>
<title>Strengths</title>
<tgroup cols="2">
<thead>
<row>
<entry>Operation</entry>
<entry>Complexity</entry>
</row>
</thead>
<tbody>
<row>
<entry>push</entry>
<entry>O(log n)</entry>
</row>
<row>
<entry>pop</entry>
<entry>O(log n)</entry>
</row>
<row>
<entry>peek</entry>
<entry>O(1)</entry>
</row>
</tbody>
</tgroup>
</table>
</para>

<para>
<table>
<title>Weaknesses</title>
<tgroup cols="2">
<thead>
<row>
<entry>Operation</entry>
<entry>Complexity</entry>
</row>
</thead>
<tbody>
<row>
<entry>Random access</entry>
<entry>Not supported</entry>
</row>
</tbody>
</tgroup>
</table>
</para>

</section>
<!-- }}} -->

<section xml:id="ds-heap.synopsis">
&reftitle.classsynopsis;

<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>Ds\Heap</classname></ooclass>

<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>Ds\Heap</classname>
</ooclass>

<oointerface>
<interfacename>Countable</interfacename>
</oointerface>
<oointerface>
<interfacename>IteratorAggregate</interfacename>
</oointerface>
<oointerface>
<interfacename>JsonSerializable</interfacename>
</oointerface>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">&Constants;</classsynopsisinfo>
<fieldsynopsis>
<modifier>const</modifier>
<type>int</type>
<varname linkend="ds-heap.constants.min-capacity">Ds\Heap::MIN_CAPACITY</varname>
<initializer>8</initializer>
</fieldsynopsis>

<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.ds-heap')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[not(@role='procedural')])" />
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.ds-heap')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[not(@role='procedural')])" />
</classsynopsis>
<!-- }}} -->

</section>

<!-- {{{ Ds\Heap constants -->
<section xml:id="ds-heap.constants">
&reftitle.constants;
<variablelist>

<varlistentry xml:id="ds-heap.constants.min-capacity">
<term><constant>Ds\Heap::MIN_CAPACITY</constant></term>
<listitem>
<para></para>
</listitem>
</varlistentry>

</variablelist>
</section>
<!-- }}} -->


</partintro>

&reference.ds.ds.entities.heap;

</reference>

<!-- 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
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
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
-->
Loading