Prev: W11, Next: W13
Links: Zoom, TopHat (010339, or Form), Calculator:
Slide:



# Tries

📗 A trie is a search tree for strings with efficient lookup, insert, and delete in \(O\left(1\right)\).
📗 Visualization: Link

# Trie Lookup Example

ID:
📗 [1 point] Insert the string: .

Dictionary:

# Emoji Full Lookup Example

ID:
📗 [1 point] Look up the string: .



# Trie Insertion Example

ID:
📗 [1 point] Insert the string: .

Dictionary:

# Trie Deletion Example

ID:
📗 [1 point] Delete the string: .

Dictionary:



# Complexities

📗 \(N\) is the number of strings in the trie, \(L\) is the length of string (number of characters).
📗 Lookup: \(O\left(L + 1\right) = O\left(L\right)\).
📗 Insert: \(O\left(L + 1\right) = O\left(L\right)\).
📗 Delete: \(O\left(2 \left(L + 1\right)\right) = O\left(L\right)\).
📗 For strings with a fixed maximum length, these are \(O\left(1\right)\).



# Readings

📗 JavaFX Hello World App: Link.
📗 JavaFX Layout Managers: Link.



📗 Notes and code adapted from the course taught by Professor Florian Heimerl and Ashley Samuelson.
📗 Please use Ctrl+F5 or Shift+F5 or Shift+Command+R or Incognito mode or Private Browsing to refresh the cached JavaScript.
📗 You can expand all the examples and demos: , or print the notes: .
📗 If there is an issue with TopHat during the lectures, please submit your answers on paper (include your Wisc ID and answers) or this Google Form at the end of the lecture.

Prev: W11, Next: W13





Last Updated: November 25, 2025 at 1:46 AM