MinHeapRecursive

public struct MinHeapRecursive<T> : Heap where T : Comparable

A MinHeapRecursive using recursive heapify methods.

Note

MinHeapRecursive conforms to Heap

Note

The datatype in the Heap must conform to Comparable.
  • Public init

    Declaration

    Swift

    public init()
  • The storage array of the Heap

    Declaration

    Swift

    public var storage: [T]
  • The MinHeapRecursive recursive heapifyUp starter method.

    Declaration

    Swift

    public mutating func heapifyUp()
  • The MinHeapRecursive recursive heapifyUp algorithm.

    Declaration

    Swift

    internal mutating func heapifyUp(at index: Int)

    Parameters

    at

    The index to heapifyUp from.

  • The MinHeapRecursive recursive heapifyDown starter method.

    Declaration

    Swift

    public mutating func heapifyDown()
  • The MinHeapRecursive recursive heapifyDown algorithm.

    Declaration

    Swift

    internal mutating func heapifyDown(at index: Int)

    Parameters

    at

    The index to heapifyDown from.