Interview Question
0of 0 voteswrite a program to search by name or phone number(mobile or PNT) in database(phonebook,directory..etc. ) for e.g query 'ry'
its should display the all possible name which contain these word or letters .arya,surya,Marya,tarry,marry....etc.
some for phone numbers.....
Country: -
can we use database query instead of data structure?
what is the complexity of searching a value in a database table of M rows?

This problem is similar to "Contacts" application in phones.
- avinashbabu.donthu on July 25, 2012 Edit | Flag ReplyWe can use "Trie" - but this will be of space complexity BigO(n)
To reduce the space complexity we can use TST.