Autocomplete systems often suggest the next word based on previous input. Which method best describes how they predict the next word?
Think about how your phone suggests words based on what you typed before.
Autocomplete uses patterns of word sequences and their frequencies learned from large text data to predict likely next words.
Spell checkers need to quickly find if a word exists in a dictionary. Which data structure is most commonly used for this purpose?
It is a tree structure that stores words by their prefixes.
Tries store words by their prefixes, allowing fast lookup and prefix matching, which is ideal for spell checking.
IP routing tables use prefix matching to decide where to send packets. Why is prefix matching important in IP routing?
Think about how IP addresses group devices in networks.
IP addresses are hierarchical; prefixes represent network segments. Prefix matching helps routers efficiently find the best route for a packet.
Both autocomplete and spell check use tries. What is a key difference in how tries are used in these two applications?
Think about what each application needs to do with the words.
Autocomplete uses tries to suggest possible word completions based on prefixes, while spell check uses tries to verify if a word exists and to find close matches for corrections.
As the internet grows, routing tables become very large. What is the main challenge routers face with large routing tables?
Consider what routers must do for each packet they receive.
Routers must quickly find the longest prefix match in large routing tables to decide the best path for each packet, which is computationally challenging as tables grow.