Which of the following is true about the trie?
(a) root is letter a
(b) path from root to the leat yields the string
(c) children of nodes are randomly ordered
(d) each node stores the associated keys
This intriguing question originated from Trie topic in section Trie of Data Structures & Algorithms I
I had been asked this question during an online exam.
1 Answers
Right answer is (b) path from root to the leat yields the string
Easiest explanation – A trie is an ordered tree where (i) the root represents an empty string(“”) (ii) each node other than root is labeled with a character (iii) the children of a nodes are lexicographically ordered (iv) the paths from the leaves to the root yields the strings.