designing a library with data structures

Go4Expert Member
1Feb2007,08:26   #1
tedman's Avatar
Another interview question.

which data structure would you use to program a library, so that books can be found very fast???
Go4Expert Member
3Feb2007,20:27   #2
friendsforniraj's Avatar
i will suggest tree
Go4Expert Founder
4Feb2007,08:02   #3
shabbir's Avatar
Quote:
Originally Posted by friendsforniraj
i will suggest tree
Hashing.
Go4Expert Member
5Feb2007,11:25   #4
tedman's Avatar
actually the interviewer said that it shudnt be an order n solution, that is the book should be found in the first try itself!
Go4Expert Founder
5Feb2007,12:24   #5
shabbir's Avatar
Quote:
Originally Posted by tedman
actually the interviewer said that it shudnt be an order n solution, that is the book should be found in the first try itself!
Hashing if first try. and any array if order of n.