Re: [algogeeks] Re: calculate a/b without using ‘*’, ‘/’’ and ‘%’

2011-08-27 Thread saurabh modi
I think that this code can suffice. http://www.ideone.com/ESW8Z #includestdio.h int solve(int,int); int main() { printf(%d,solve(100,10)); return 0; } int solve(int a,int b) { int quotient=0,k=0; if(ab) return quotient; while((1k)*b=a) { k++; } k--;

Re: [algogeeks] Re: Given a number, return the least prime greater than number

2011-08-27 Thread saurabh modi
use sieve.then make a list of primes. A binary search can work well to find the next greater prime number. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from

Re: [algogeeks] Re: calculate a/b without using ‘*’, ‘/’’ and ‘%’

2011-08-27 Thread saurabh modi
haha yeah okay..that can be done :-) i had forgotten abt * -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to

Re: [algogeeks] Longest palindrome

2011-08-21 Thread saurabh modi
dp will work fine. :-) O(n^2) algo. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For

Re: [algogeeks] amazon

2011-08-04 Thread saurabh modi
the simplest solution for longest increasing continuous array length is O(n) and the simplest solution for longest increasing continuous subsequence length is O(n^2). a solution for spiral is http://www.ideone.com/ygjsq -- You received this message because you are subscribed to the Google

Re: [algogeeks] amazon

2011-08-04 Thread saurabh modi
*longest increasing continuous subsequence length=longest increasing subsequence length in my previous mail. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from

Re: [algogeeks] Microsoft Internship

2011-08-02 Thread saurabh modi
hey man,could you tell something abt the attire and all.? we dont need to go in formals,right? plus,koi interview and all hoga? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To

Re: [algogeeks] Convert number to negative base

2011-07-31 Thread saurabh modi
it should. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this

Re: [algogeeks] Convert number to negative base

2011-07-31 Thread saurabh modi
yeah,only some compilers support it. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For

Re: [algogeeks] Convert number to negative base

2011-07-31 Thread saurabh modi
you can read up the http://en.wikipedia.org/wiki/Negative_base#Calculationpart on the wiki page http://en.wikipedia.org/wiki/Negative_base its explained quite effectively. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group,