I wanted store all the words of an English dictionary along with their meanings. Then what is the suitable data structures I have to use for it, to store efficiently so that I can insert and find a word meaning easily.
Use array to store all the meanings of all the words, with the help of hash code for each word [or] key.
create a separate linked list for each word, where each linked list will have all the synonyms of a given word. and maintain all the words in an array.
Use hash table (table of buckets) technique, where each bucket will contain linked list of entries for words with key,value pairs. each word will have a pointer to particular bucket based on its hash code.
User binary tree to insert all the words, and in the leaf nodes maintain a pointer to a linked list which will contain synonyms for that word.
Back To Top