26.1 Introduction to Tries
Do or do not. There is no Trie.
Special Case 1: Character Keyed Map
public class DataIndexedCharMap<V> {
private V[] items;
public DataIndexedCharMap(int R) {
items = (V[]) new Object[R];
}
public void put(char c, V val) {
items[c] = val;
}
public V get(char c) {
return items[c];
}
}Special Case 2: String Keyed Map
Trie Demo







Tries as Maps
Summary
Last updated