Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Tries:Data structure by searching string keys
- 1. R-way tries, even faster than red-black BST and hashing
- 2. Store characters in nodes
- 3. Store values in nodes corresponding to last characters in keys
- 4. Search until the ending character with a non-null value
- 5. Insertion: create link until the last character and set value in that node
- 6. Node: a value +references to R nodes
- 7. Search hit: all L characters, search miss: typical sublinear, space: R null links at each leaf
- 8. Spell check: 26-way trie
- 9. deletion: set the value to null
- 2. Ternary Search
- 1. Store characters and values in nodes
- 2. Each node has 3 children: smaller, equal, and larger (3-way)
- 3. Search: if less left, if greater right
- 4. if equal, take the middle link and move to the next key character (+1)
- 5. 3 null links in each leaf (less null links than r-way tries if r>3), much space efficient in large R
- 6. Space 4N
- 7. Hybrid of r^2-way trie and TST: root has r^2 nodes, even quicker
- 8. Faster than hashing and more flexible than red-black BST
- 3. Character-based operations
- 1. Prefix-match, wildcard match
- 2. Longest-prefix
- 3. Patricia trie: each node represents a sequence of characters
- 4. Suffix-tree (Patricia trie of suffixes of a string, linear-time construction)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement