+1 vote
in Data Structures & Algorithms I by (88.2k points)
What can be the maximum depth of the trie with n strings and m as the maximum sting the length?

(a) log2n

(b) log2m

(c) n

(d) m

My doubt is from Trie in division Trie of Data Structures & Algorithms I

This question was addressed to me at a job interview.

1 Answer

+1 vote
by (672k points)
selected by
 
Best answer
The correct choice is (d) m

Best explanation: In the trie, the strings are stored efficiently based on the common prefixes. And trie has maximum fan-out 26 if english alphabets are considered. Owing to this, the maximum depth is equal to the maximum string length.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...