Re: [algogeeks] Re: Amazon Interview Question

2013-02-12 Thread Mohanabalan D B
can use counting sort On Sun, Jul 15, 2012 at 6:37 PM, santosh thota wrote: > If we can retrieve ith prime efficiently, we can do the following... > 1.maintain a prod=1, start from 1st element, say a[0]=n find n th prime > 2.check if (prod% (ith_prime * ith_prime )==0) then return i; >

Re: [algogeeks] MS Question

2013-01-20 Thread Mohanabalan D B
http://stackoverflow.com/questions/2329171/find-kth-smallest-element-in-a-binary-search-tree-in-optimum-way On Sun, Jan 20, 2013 at 4:57 PM, Guneesh Paul Singh wrote: > not possible unless u use augmented bst..which itself takes o(n) to built > > -- > > > --