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 |
Definition at line 12 of file PriorityQueue.class.php.
PriorityQueue::__construct | ( | $ | unsortedData = array() |
) |
Definition at line 33 of file PriorityQueue.class.php.
References buildMaxHeap().
PriorityQueue::buildMaxHeap | ( | ) |
Definition at line 97 of file PriorityQueue.class.php.
References maxHeapify().
Referenced by __construct().
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().
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().
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().
PriorityQueue::push | ( | $ | elt | ) |
Definition at line 118 of file PriorityQueue.class.php.
References parent(), PrimitiveInteger::SIGNED_MIN, and swapElts().
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().
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.