MaxHeapRecursive

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

A MaxHeapRecursive using recursive heapify methods.

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 MaxHeapRecursive recursive heapifyUp starter method.

    Declaration

    Swift

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

    Declaration

    Swift

    internal mutating func heapifyUp(at index: Int)

    Parameters

    at

    The index to heapifyUp from.

  • The MaxHeapRecursive recursive heapifyDown starter method.

    Declaration

    Swift

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

    Declaration

    Swift

    internal mutating func heapifyDown(at index: Int)

    Parameters

    at

    The index to heapifyDown from.