TrieNode

TrieNode

A Trie node

Constructor

new TrieNode()

Source:

A single node of a Trie structure.

Methods

get(key) → {*}

Source:

Retrieve the data attached to a key.

Parameters:
Name Type Description
key *
Returns:
Type
*

getNodeForKey(key, touchopt) → {TrieNode}

Source:

Retrieve the node instance that holds the key. If touch is set then missing nodes will be created. Guarantees that an instance will be returned. The implementation is structural, not recursive.

Parameters:
Name Type Attributes Default Description
key String
touch Boolean <optional>
false
Returns:
Type
TrieNode

put(key, value)

Source:

Put a value into the structure. Attach some data to it.

Parameters:
Name Type Description
key String
value *