MaxHeapRecursive
struct MaxHeapRecursive<T> : Heap where T : Comparable
A MaxHeapRecursive
using recursive heapify methods.
-
The storage array of the
Heap
Declaration
Swift
internal var storage: [T]
-
The
MaxHeapRecursive
recursiveheapifyUp
starter method.Declaration
Swift
internal mutating func heapifyUp()
-
The
MaxHeapRecursive
recursiveheapifyUp
algorithm.Declaration
Swift
internal mutating func heapifyUp(at index: Int)
Parameters
at
The index to
heapifyUp
from. -
The
MaxHeapRecursive
recursiveheapifyDown
starter method.Declaration
Swift
internal mutating func heapifyDown()
-
The
MaxHeapRecursive
recursiveheapifyDown
algorithm.Declaration
Swift
internal mutating func heapifyDown(at index: Int)
Parameters
at
The index to
heapifyDown
from.