Link Search Menu Expand Document

LeftistHeap overview

Added in v0.1.0


Table of contents


utils

LeftistHeap (type alias)

Signature

export type LeftistHeap<A> =
  | { readonly type: 'Leaf' }
  | {
      readonly type: 'Node'
      readonly rank: number
      readonly left: LeftistHeap<A>
      readonly value: A
      readonly right: LeftistHeap<A>
    }

Added in v0.1.0

URI

Signature

export declare const URI: 'LeftistHeap'

Added in v0.1.0

URI (type alias)

Signature

export type URI = typeof URI

Added in v0.1.0

leaf

Signature

export declare const leaf: { readonly type: 'Leaf' }

Added in v0.1.0

leftistHeap

Signature

export declare const leftistHeap: PHeap<'LeftistHeap'>

Added in v0.1.0

makeT

Signature

export declare const makeT: <A>(value: A, a: LeftistHeap<A>, b: LeftistHeap<A>) => LeftistHeap<A>

Added in v0.1.0

node

Signature

export declare const node: <A>({
  rank,
  left,
  value,
  right,
}: {
  rank?: number
  left?: LeftistHeap<A>
  value: A
  right?: LeftistHeap<A>
}) => LeftistHeap<A>

Added in v0.1.0

rank

Signature

export declare const rank: <A>(h: LeftistHeap<A>) => number

Added in v0.1.0