|
Add(TObject,Integer)
|
Overloaded. Adds the item to the heap based on its priority.
When an item is added to the heap. It is pushed up from the bottom of the heap (the tree) until its Priority is not bigger (according to Order ) than any of its parents.
|
|
Delete(Integer)
|
Deletes the node or heap element at the specified index in the heap. The item at the specified node is returned.
If the item to delete is the last one, delete it and shrink the tree, the tree will still be a heap. Otherwise, delete replace the item with the lowest, rightmost item in the heap and "reheapify".
|
|
GetItem(Integer)
|
Returns the item in the heap at the specified position. (Overrides DataStructures.TCustomHeap.GetItem(Integer).)
|
|
IndexOf(Integer)
|
Overloaded. Returns the index of the element in the heap that matches the specified priority. If no element has that priority, the function returns -1.
|
|
IndexOf(TObject)
|
Overloaded. Returns the index of the element in the heap that matches the specified item (with an assumed priority of 0). If they are not found, the function returns -1. (Overrides DataStructures.TCustomHeap.IndexOf(TObject).)
|
|
IndexOf(TObject,Integer)
|
Overloaded. Returns the index of the element in the heap that matches the specified item and priority. If they are not found, the function returns -1.
|
|
ModifyPriority(THeapElement)
|
Overloaded. Modifies the priority the heap element in the heap. The index of the element is returned. (Overrides DataStructures.TCustomHeap.ModifyPriority(THeapElement).)
|
|
ModifyPriority(THeapElement,Integer)
|
Overloaded. Modifies the priority the heap element at the specified index position in the heap. The new index of the element is returned.
|
|
PushDown(Integer)
|
Push the Parent down the tree if it is smaller (according to Order) than one of its children
The DataStructures.TCustomHeap.PushUp(Integer) and DataStructures.TCustomHeap.PushDown(Integer) methods maintain the sort order of the heap. These methods are O(n) in efficiency.
|
|
PushUp(Integer)
|
Push the last value up the tree until it is not bigger (according to Order) than any of its parents.
The DataStructures.TCustomHeap.PushUp(Integer) and DataStructures.TCustomHeap.PushDown(Integer) methods maintain the sort order of the heap.
|