GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Concepts  >  Data Structures
Go To First  |  Previous Question  |  Next Question 
 Data Structures  |  Question 194 of 202    Print  
Data Structure for one million named objects
If you have one million named objects and you want to store them in a data structure that lets you insert new objects quickly and search for an object by name quickly, what data structure should you use?


  
Total Answers and Comments: 7 Last Update: October 26, 2009     Asked by: bitsbyter 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Hemantgupta83
 
Binary tree

Above answer was rated as good by the following members:
rajani_vaddepalli15, aman15490, ravi6771, rohini.nitd, kronos
September 20, 2008 08:59:28   #1  
Hemantgupta83 Member Since: February 2008   Contribution: 1    

RE: Data Structure for one million named objects
Binary tree
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
September 23, 2008 04:23:04   #2  
skmandowara Member Since: September 2008   Contribution: 1    

RE: Data Structure for one million named objects
One Million Named Objects:

1. I dont think binary Tree is a good idea. Depth of the tree will be huge
2. B+ Tree is the right Data structure

 
Is this answer useful? Yes | NoAnswer is useful 3   Answer is not useful 0Overall Rating: +3    
September 24, 2008 11:09:40   #3  
veerun14 Member Since: September 2008   Contribution: 4    

RE: Data Structure for one million named objects
Since the objects are named I would go for the hash table.
 
Is this answer useful? Yes | No
April 01, 2009 05:54:12   #4  
katrin.shechtman Member Since: April 2009   Contribution: 1    

RE: Data Structure for one million named objects

I think the most suitable here will be a dictionary solution - the
tree where each node contains a letter. And each name will be a word
in such a dictionary so we need the node also contains the sign that
there is a name ends here (let's say -|). For example:


N | M | ...

I | O I | ...

K-| | L K-| | ...

| L | ...


| Y-| | ...



 
Is this answer useful? Yes | No
April 03, 2009 13:02:48   #5  
nirmo420 Member Since: April 2009   Contribution: 2    

RE: Data Structure for one million named objects
Since there is the question about serching and insertion quickly i think the data structure should be binary serach tree not simple binary tree
 
Is this answer useful? Yes | No
October 23, 2009 01:09:30   #6  
vinod148 Member Since: April 2008   Contribution: 6    

RE: Data Structure for one million named objects
The ultimate solution for this is TRIE or advanced TRIE
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
October 26, 2009 06:20:54   #7  
dwaramkavithareddy Member Since: October 2009   Contribution: 1    

RE: Data Structure for one million named objects
AVL trees
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape