+1 vote
in Data Structures & Algorithms I by (88.2k points)
Which of the following is the efficient data structure for searching words in dictionaries?

(a) BST

(b) Linked List

(c) Balancded BST

(d) Trie

My question comes from Trie in chapter Trie of Data Structures & Algorithms I

This question was addressed to me in semester exam.

1 Answer

+1 vote
by (672k points)
selected by
Best answer
Correct choice is (d) Trie

Easiest explanation - In a BST, as well as in a balanced BST searching takes time in order of mlogn, where m is the maximum string length and n is the number of strings in tree. But searching in trie will take O(m) time to search the key.

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.