Computer Science 226
Algorithms and Data Structures
Spring 2013
|
|
|
Course Information |
Assignments |
Exercises |
Lectures |
Exams |
Precepts |
Booksite
Tries
Things to Know Before Lecture
- Know the basics about Tries (also known as prefix trees):
- A trie is a special purpose symbol table that maps String keys to values.
- How to insert into a trie.
- How to search for a string in a trie.
- How to delete a string key from a trie.
- Know that tries use way too much memory to be practical in most applications.
- KNow the basics about TSTs:
- A TST is a trie that has 3 child links instead of R.
- How to insert into a TST.
- How to search for a string in a trie.
Pre-Lecture Preparation Guide.
High priority topics are in red. Medium priority topics are in green. Low priority topics are in blue.
Checkpoint 1:
Insert {"by", 4}, {"sea", 6}, {"sells", 1}, {"she", 0}, {"shells", 3}, {"shore", 7}, and {"the, 5"}. Then delete "shells". You should end up with the trie shown below:
Checkpoint 2: After inserting {"she", 0}, {"sells" 1}, {"sea", 2}, {"shells", 3}, you should get the TST shown below: