Re: [algogeeks] Microsoft interview qs

2012-06-30 Thread atul anand
i have fixed your code but it is alwayz better to use recursive function for creating trie. i have wrote my own recursive function to create TRIE... you can understand the same bcozz iterative one make thing unnecessary complicated. here check the code link :- http://ideone.com/6HhFZ have fu

Re: [algogeeks] Microsoft interview qs

2012-06-30 Thread Ashish Goel
trie or ternary tree and build stack for the string being entered, keep distributed hashmap for head/tail queries like cricket, weather, finance etc various domains etc.. Best Regards Ashish Goel "Think positive and find fuel in failure" +919985813081 +919966006652 On Sat, Jun 30, 2012 at 12:05

Re: [algogeeks] Microsoft interview qs

2012-06-29 Thread shady
i am not sure if it is possible to change the length of an already declared array, so i think one might wanna use pointers instead. Allocate memory dynamically. On Thu, Jun 28, 2012 at 2:36 PM, deepikaanand wrote: > //Taken from careercup.com > > Design the autocomplete feature (ex:Google Suggest

[algogeeks] Microsoft interview qs

2012-06-28 Thread deepikaanand
//Taken from careercup.com Design the autocomplete feature (ex:Google Suggest) I assumed {"abcde","abcegh","abcpqr","abcxyz","xyz" ,"abcmno"} URLs and stored them in trie...Such if the user enters abc ...the o/p will be abc is a prefix in 5 number of cases d e e g h m n o p q r x y z