Which of the following is the efficient data structure for searching words in dictionaries?

Category: QuestionsWhich of the following is the efficient data structure for searching words in dictionaries?
Editor">Editor Staff asked 5 months ago

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 Answers
Editor">Editor Staff answered 5 months ago

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.


Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17
Articles: 40702