Options
All
  • Public
  • Public/Protected
  • All
Menu

A node, for usage in a (doubly) linked list. Each LinkedListNode is linked to two other nodes: linkage should be reflexive.

LinkedListNodes don't necessarily have a notion of a "previous" and a "next" node. But when these are required, by convention, node0 is the next node, and node1 is the previous.

Type parameters

  • T

    The type of the value stored in the node.

Hierarchy

  • LinkedListNode

Index

Constructors

constructor

Properties

Private ID

ID: number

A unique, immutable identifier for the node.

Private node0

node0: LinkedListNode<T> | undefined

One of the nodes adjacent to this. When the graph has a given direction, this is taken to be the "next" node.

Private node1

node1: LinkedListNode<T> | undefined

One of the nodes adjacent to this. When the graph has a given direction, this is taken to be the "previous" node.

traversed

traversed: boolean

Whether the node has been traversed. Useful for certain algorithms.

value

value: T

A value stored in the node.

Static Private idCounter

idCounter: number = 0

Represents the number of existing nodes. Used to distinguish between identical elements consistently.

Methods

Private _linkTo

getCycle

  • getCycle(): T[]

getId

  • getId(): number

getNode

getOrderedCycle

  • getOrderedCycle(): T[]

linkTo

linkToNext

linkToPrev

Generated using TypeDoc, the 1/31/2021 at 6:18:55 AM