Defines the base class for a heap. The TCustomHeap class defines some common denominator methods and properties for implementing a heap.
A heap is a complete binary tree where every node's value is guaranteed to be greater (or lesser depending on
Order) than its children's values. The
Count is 0 to Max-1.
Namespace: DataStructures
Delphi
|
type
TCustomHeap = class(TPersistent)
end;
|
|
Name
|
Description
|
|
Create
|
Overloaded. Creates and initializes the heap
|
|
Create(THeapElementClass)
|
Overloaded. Creates and initializes the heap. The ElementClass parameter specifies the THeapElement class to create for every node in the heap.
|
|
Destroy
|
Represents the destructor of the TCustomHeap 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
|