FibonacciHeap<TElement> Class |
Some time ago another variant (actually two variants) of the Fibonacci heap, the 'Relaxed' Fibonacci Heap has been proposed, one has the same characteristics as the Fibonacci heap and one has some operations more efficient. As the implementation of a Relaxed Fibonacci Heap is quite complex we've postponed its implementation till a later date. For more information about Relaxed Fibonacci Heaps, please see: http://www.pmg.lcs.mit.edu/~chandra/publications/heap.pdf Relaxed Fibonacci Heaps have a slight advantage in parallel environments.
Namespace: SD.Tools.Algorithmia.Heaps
The FibonacciHeap<TElement> type exposes the following members.
Name | Description | |
---|---|---|
![]() | FibonacciHeap<TElement> |
Initializes a new instance of the FibonacciHeap<TElement> class.
|
Name | Description | |
---|---|---|
![]() | Count |
Gets the number of elements in the heap.
(Overrides HeapBase<TElement>.Count.) |
![]() | ElementCompareFunc |
Gets the element compare func, which is the func to compare two elements based on the heap type: the function returns true if the first element
is indeed the correct parent of the second element or false if not.
(Inherited from HeapBase<TElement>.) |
![]() | IsMinHeap |
Gets a value indicating whether this instance is a min heap (true) or a max heap (false)
(Inherited from HeapBase<TElement>.) |
![]() | KeyCompareFunc |
Gets the key compare func to compare elements based on key.
(Inherited from HeapBase<TElement>.) |
![]() | Root |
Gets the root of the heap. Depending on the fact if this is a min or max heap, it returns the element with the minimum key (min heap) or the element
with the maximum key (max heap). If the heap is empty, null / default is returned
(Overrides HeapBase<TElement>.Root.) |
Name | Description | |
---|---|---|
![]() | Clear |
Clears all elements from the heap
(Overrides HeapBase<TElement>.Clear().) |
![]() | Contains |
Determines whether this heap contains the element specified
(Overrides HeapBase<TElement>.Contains(TElement).) |
![]() | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() | ExtractRoot |
Extracts and removes the root of the heap.
(Overrides HeapBase<TElement>.ExtractRoot().) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | Insert |
Inserts the specified element into the heap at the right spot.
(Overrides HeapBase<TElement>.Insert(TElement).) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | Merge |
Merges the specified heap into this heap.
|
![]() | Remove |
Removes the element specified
(Overrides HeapBase<TElement>.Remove(TElement).) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() | UpdateKey<TKeyType>(TElement, Action<TElement, TKeyType>, TKeyType) |
Updates the key of the element passed in. Only use this method for elements where the key is a property of the element, not the element itself.
This means that if you have a heap with value typed elements (e.g. integers), updating the key is updating the value of the element itself, and because
a heap might contain elements with the same value, this could lead to undefined results.
(Overrides HeapBase<TElement>.UpdateKey<TKeyType>(TElement, Action<TElement, TKeyType>, TKeyType).) |
![]() | UpdateKey<TKeyType>(TElement, Action<TElement, TKeyType>, TKeyType) |
Updates the key of the element passed in. Only use this method for elements where the key is a property of the element, not the element itself.
This means that if you have a heap with value typed elements (e.g. integers), updating the key is updating the value of the element itself, and because
a heap might contain elements with the same value, this could lead to undefined results.
(Inherited from HeapBase<TElement>.) |