How does a T9 dictionary work? What is the data structure behind it. If we type '4663' we get 'good' when we press down button we get 'gone' then 'home' etc...
EDIT: If the user types in 46 then it should show 'go' and when pressed down arrow should show 'gone' etc...
It can be implemented in several ways, one of them is Trie. The route is represented by the digits and the nodes point to collection of words.
It can be implemented using nested hash tables as well, the key of the hash table is a letter and on every digit the algorithm calculates all possible routes (O(3^n) routes).