Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TrieNode

Hierarchy

  • TrieNode

Constructors

constructor

  • new TrieNode(character: string, isCompleteWord?: boolean): TrieNode
  • Parameters

    • character: string
    • isCompleteWord: boolean = false

    Returns TrieNode

Properties

character

character: string
property

Character

children

children: HashTable
property

Children of current node

isCompleteWord

isCompleteWord: boolean
property

Flag for marking a complete word

Methods

addChild

  • addChild(character: string, isCompleteWord?: boolean): TrieNode
  • Parameters

    • character: string
    • isCompleteWord: boolean = false

    Returns TrieNode

getChild

  • Parameters

    • character: string

    Returns TrieNode

hasChild

  • hasChild(character: string): boolean
  • Parameters

    • character: string

    Returns boolean

hasChildren

  • hasChildren(): boolean
  • Returns boolean

removeChild

  • removeChild(character: string): TrieNode
  • Parameters

    • character: string

    Returns TrieNode

suggestChildren

  • suggestChildren(): string[]
  • Returns string[]

toString

  • toString(): string
  • Returns string