Re: [algogeeks] Amazon: sort array

2010-07-02 Thread Siddharth Prakash Singh
://groups.google.com/group/algogeeks?hl=en. -- Siddharth Prakash Singh http://www.spsneo.com -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group

[algogeeks] Monte Carlo Algorithm to find a repeated element

2010-02-09 Thread Siddharth Prakash Singh
An array arr has n/4 copies of a particular unknown element x. Every other element in arr has at most n/8 copies. Give an O(logn) time Monte Carlo alorithm to identify x. The answer should be correct with high probability. -- You received this message because you are subscribed to the Google

Re: [algogeeks] Sort the data from a big file.

2009-12-21 Thread Siddharth Prakash Singh
. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Siddharth Prakash Singh http://www.spsneo.com -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge

[algogeeks] Finding first and last k digits of n^n

2009-11-23 Thread Siddharth Prakash Singh
Can anybody suggest an algorithm to find first and last k digits of n^n. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to

Re: [algogeeks] Finding first and last k digits of n^n

2009-11-23 Thread Siddharth Prakash Singh
, t=n % m; while(n) { if (n % 2) r = r * t % m; t = t * t % m; n = 1; } return r; } On Sat, Nov 21, 2009 at 9:44 AM, Siddharth Prakash Singh sps...@gmail.com wrote: Can anybody suggest an algorithm to find first and last k digits of n^n. -- You received