Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

PriorityQueue Class Reference

List of all members.

Public Member Functions

 getLength ()
 first ()
 __construct ($unsortedData=array())
 setCmpFunction ($function)
 parent ($index)
 left ($index)
 right ($index)
 maxHeapify ($index)
 buildMaxHeap ()
 pop ()
 push ($elt)
 delete ($index)

Static Public Member Functions

static create ($unsortedData=array())

Private Member Functions

 swapElts ($index1, $index2)

Private Attributes

 $heap = array(0)
 $heapSize = 0
 $cmpFunction = null

Detailed Description

Definition at line 12 of file PriorityQueue.class.php.


Constructor & Destructor Documentation

PriorityQueue::__construct ( unsortedData = array()  ) 

Definition at line 33 of file PriorityQueue.class.php.

References buildMaxHeap().

Here is the call graph for this function:


Member Function Documentation

PriorityQueue::buildMaxHeap (  ) 

Definition at line 97 of file PriorityQueue.class.php.

References maxHeapify().

Referenced by __construct().

Here is the call graph for this function:

static PriorityQueue::create ( unsortedData = array()  )  [static]

Definition at line 28 of file PriorityQueue.class.php.

PriorityQueue::delete ( index  ) 

Definition at line 144 of file PriorityQueue.class.php.

References maxHeapify().

Here is the call graph for this function:

PriorityQueue::first (  ) 

Definition at line 23 of file PriorityQueue.class.php.

PriorityQueue::getLength (  ) 

Definition at line 18 of file PriorityQueue.class.php.

PriorityQueue::left ( index  ) 

Definition at line 63 of file PriorityQueue.class.php.

Referenced by maxHeapify().

PriorityQueue::maxHeapify ( index  ) 

Definition at line 73 of file PriorityQueue.class.php.

References left(), right(), and swapElts().

Referenced by buildMaxHeap(), delete(), and pop().

Here is the call graph for this function:

PriorityQueue::parent ( index  ) 

Definition at line 58 of file PriorityQueue.class.php.

Referenced by push().

PriorityQueue::pop (  ) 

Definition at line 104 of file PriorityQueue.class.php.

References maxHeapify().

Here is the call graph for this function:

PriorityQueue::push ( elt  ) 

Definition at line 118 of file PriorityQueue.class.php.

References parent(), PrimitiveInteger::SIGNED_MIN, and swapElts().

Here is the call graph for this function:

PriorityQueue::right ( index  ) 

Definition at line 68 of file PriorityQueue.class.php.

Referenced by maxHeapify().

PriorityQueue::setCmpFunction ( function  ) 

Definition at line 51 of file PriorityQueue.class.php.

PriorityQueue::swapElts ( index1,
index2 
) [private]

Definition at line 155 of file PriorityQueue.class.php.

Referenced by maxHeapify(), and push().


Member Data Documentation

PriorityQueue::$cmpFunction = null [private]

Definition at line 16 of file PriorityQueue.class.php.

PriorityQueue::$heap = array(0) [private]

Definition at line 14 of file PriorityQueue.class.php.

PriorityQueue::$heapSize = 0 [private]

Definition at line 15 of file PriorityQueue.class.php.


The documentation for this class was generated from the following file: