TrieNode represents a node in the Trie data structure. It holds a character key, a map of children nodes, and a flag indicating whether it's the end of a word.

Accessors

Accessors

  • get children(): Map<string, TrieNode>
  • The function returns the children of a TrieNode as a Map.

    Returns Map<string, TrieNode>

    The children property of the TrieNode object, which is a Map containing string keys and TrieNode values.

  • set children(value): void
  • The function sets the value of the _children property of a TrieNode object.

    Parameters

    • value: Map<string, TrieNode>

      The value parameter is a Map object that represents the children of a TrieNode. The keys of the map are strings, which represent the characters that are associated with each child TrieNode. The values of the map are TrieNode objects, which represent the child nodes of the current TrieNode.

    Returns void

  • get isEnd(): boolean
  • The function returns a boolean value indicating whether a certain condition is met.

    Returns boolean

    The method is returning a boolean value, specifically the value of the variable _isEnd.

  • set isEnd(value): void
  • The function sets the value of the "_isEnd" property.

    Parameters

    • value: boolean

      The value parameter is a boolean value that indicates whether the current state is the end state or not.

    Returns void

  • get key(): string
  • The function returns the value of the protected variable _key.

    Returns string

    The value of the _key property, which is a string.

  • set key(value): void
  • The above function sets the value of a protected variable called "key".

    Parameters

    • value: string

      The value parameter is a string that represents the value to be assigned to the key.

    Returns void

Generated using TypeDoc