Ask your own question, for FREE!
Computer Science 7 Online
OpenStudy (anonymous):

When given an English dictionary consisting of some 10,00,000 words, what could be the useful and optimal data structure that could be used to store this...?

OpenStudy (anonymous):

guys pls do me the answer for this :( :(

OpenStudy (anonymous):

well i guess u would not be storing 10,00,000 words in memory so disk storage will be your option. so i guess u can use hashing to store the words as keys and then store explanations in other files.. if this is not what u need then pls explain ur requirement a bit..

OpenStudy (anonymous):

a binary tree, search in it is O(logn) where n its the number of words an hash table works faster its O(1) for searching and inserting here u can find more info on the differences: http://www.informit.com/guides/content.aspx?g=java&seqNum=472 If u are using c++ u can us map wich its a binary tree i think, and a hash_map or unordered_map in c++ wich are a hashtable in Java in the link i gave u they tell wich one are Both are good, use the one that suits u.

OpenStudy (anonymous):

I think a b-tree would be a better option. Also note that depending on the number of bits in the generated hash (2^n for n bits is the number of hash bins) there may be lots of collisions.

OpenStudy (anonymous):

Also a tree structure will have better time complexity for searching by inequality.

OpenStudy (anonymous):

if we could use the hash table, then what could be the hash function that could be used...?that could avoid many collisions...?? can anyone suggest specific to this example?

OpenStudy (anonymous):

am not an expert google there is plenty of info about that. Search hash function strings somthing like that

OpenStudy (anonymous):

@fedep3 will try dude.... thanks a lot :) :)

OpenStudy (anonymous):

I would say a quicksort algorithm, but a binary tree may be faster?

OpenStudy (anonymous):

We are talking about the correct data structure to use to store the data, not how to sort an unsorted set of data.

OpenStudy (anonymous):

then the correct term is data storage device and not data structure!

OpenStudy (anonymous):

no its data structure. a structure for storing data, a tree, a hash table, etc

OpenStudy (anonymous):

http://en.wikipedia.org/wiki/Data_structure, no mention of a hard-drive etc.

OpenStudy (anonymous):

*sigh* This is theoretical obviously.

OpenStudy (anonymous):

No, this is fact!

OpenStudy (anonymous):

From wikipeidia: " a data structure is a particular way of storing and organizing data"

OpenStudy (anonymous):

This is exactly what I said before. You were confusing an algorithm and a data structure.

OpenStudy (anonymous):

a particular way not device...

OpenStudy (anonymous):

When did I mention a device anywhere here....

OpenStudy (anonymous):

And you don't understand what theory means.

OpenStudy (anonymous):

obviously I dont! lol

OpenStudy (anonymous):

I recommend using a Trie. http://en.wikipedia.org/wiki/Trie

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!