public class Trie<K,V> extends Object
| Constructor and Description |
|---|
Trie() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(K[] keys,
V value)
Check for current node be null,
Check if this node matches with the current position node
If yes moved to the curr.firstChild and increment currPosition
If not then move to curr.rightSibling and repeat from 1st step
If no match found and reached the end then add all nodes left as firstChild
|
V |
get(K[] keys) |
void |
printAllPaths(String separator) |
public void add(K[] keys, V value)
public void printAllPaths(String separator)
Copyright © 2016. All rights reserved.