Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SortedList<T>

A sorted list implementation. NOTE: this implementation is not self-balancing

Type parameters

  • T

Hierarchy

  • SortedList

Index

Constructors

constructor

  • new SortedList(getComparable: function): SortedList
  • Parameters

    • getComparable: function
        • (): any
        • Returns any

    Returns SortedList

Properties

Private _getComparable

_getComparable: Function

Private _root

Methods

Private _cleanup

Private _find

  • Parameters

    Returns boolean

Private _findMinNode

Private _get

  • Parameters

    Returns any

Private _insert

  • Parameters

    Returns boolean

Private _list

  • Parameters

    Returns void

Private _remove

add

  • add(element: any): boolean
  • Parameters

    • element: any

    Returns boolean

find

  • find(element: any): boolean
  • Parameters

    • element: any

    Returns boolean

get

  • get(key: number): any[]
  • Parameters

    • key: number

    Returns any[]

list

  • list(): Array<T>
  • Returns Array<T>

removeByComparable

  • removeByComparable(element: any): void
  • Parameters

    • element: any

    Returns void