Interface ListStructure<T>

Interface for a list data structure.

Type Parameters

  • T

    The type of elements held in the list.

Hierarchy

Implemented by

Properties

clear: (() => void)

Type declaration

    • (): void
    • Clears the structure.

      Returns void

hasRoom: boolean

Indicates whether the structure has room for more elements.

isEmpty: boolean

Indicates whether the structure is empty.

isFull: boolean

Indicates whether the structure is full.

items: readonly T[]

An array of all the elements in the list.

peek: (() => undefined | T)

Type declaration

    • (): undefined | T
    • Returns the first element in the list without removing it.

      Returns undefined | T

      The first element in the list, or undefined if the list is empty.

size: number

The number of elements in the list.

space: number

The available space in the structure.