Defines a heap which uses a user passed
Compare function to sort the interface items in the heap.
A heap is a complete binary tree where every node's value is guaranteed to be greater (or lesser depending on DataStructures.TIHeap.Order and its comparison function) than its children's values. The DataStructures.TIHeap.Count is 0 to Max-1.
Namespace: DataStructures
Delphi
|
type
TIHeap = class(TPersistent)
end;
|
|
Name
|
Description
|
|
Create(TICompareFunc)
|
Overloaded. Creates and initializes the heap.
The CompareFunc specifies the comparison function for sorting the items in the heap.
|
|
Create(TIHeapElementClass)
|
Overloaded. Creates and initializes the heap.
The ElementClass parameter specifies the TIHeapElement class to create for every node in the heap.
|
|
Destroy
|
Represents the destructor of the TIHeap class.
|
Top
|
|
Name
|
Description
|
|
Count
|
Returns the number of items in the heap
|
|
ElementClass
|
Specifies the heap element class to create for every node in the heap.
|
|
Element[Integer]
|
Returns the heap element at the specified position
|
|
Heap
|
Stores the nodes that make up the heap
|
|
Item[Integer]
|
Returns the item in the heap at the specified position.
|
|
Order
|
Specifies the order of items in the heap.
|
Top
|
|
Name
|
Description
|
|
Compare
|
Provides the comparison function that orders the heap.
|
Top
|
The class combines the code of TCustomHeap with THeap to make a heap for interfaces.
|