Data Structures

Assume you have large set of data, say more than 100,000 elements. Each data element has a unique string associated with it.
1. What data structure has the optimal algorithmic access time to any element when the only thing you know about the element is the unique string associated with it?
2. What is the O() time for access to any element using this data structure?
3. What data structures would you use in the implementation of a single new data structure that has all of the following properties? Explain how this implementation works.
o Optimal algorithmic random access time to any element knowing only the unique string associated with it (as above)
o Keeps track of the order of insertion into the data structure, so you can acquire the elements back in the same order
o Optimal algorithmic random access time to any element knowing only the index of insertion.

Questions by musclebai   answers by musclebai

Showing Answers 1 - 3 of 3 Answers

Loki117

  • Dec 28th, 2008
 

1) Hashtable  

2) 0(n-1)

3) An arraylist which contains keys to a hashtable which contains the data this covers all requirements.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions