Re: [algogeeks] Re: Question on checking divisibility of binomial coefficients of a number by a prime number

2012-08-27 Thread Ankit Singh
: @Ankit: Apply Lucas' Theorem, which you can find written up in Wikipedia. Dave On Sunday, August 26, 2012 3:57:18 PM UTC-5, Ankit Singh wrote: In mathematics, *binomial coefficients* are a family of positive integers that occur as coefficients in the binomial theorem. [image: \tbinom nk

[algogeeks] Question on checking divisibility of binomial coefficients of a number by a prime number

2012-08-26 Thread Ankit Singh
In mathematics, *binomial coefficients* are a family of positive integers that occur as coefficients in the binomial theorem. [image: \tbinom nk]denotes the number of ways of choosing k objects from n different objects. However when n and k are too large, we often save them after modulo

Re: [algogeeks] INTRVIEW QUESTION

2012-08-12 Thread Ankit Singh
is output is depend on no of digits in a number like 123 example for odd no of digits and 121224 example for even digits??? can you make it clear pls?? On Sat, Aug 11, 2012 at 5:22 PM, payal gupta gpt.pa...@gmail.com wrote: Given the start and an ending integer as user input, generate all

Re: [algogeeks] INTRVIEW QUESTION

2012-08-12 Thread Ankit Singh
if i am correctly understand the problem den i hv attchd the solution.. On Sun, Aug 12, 2012 at 12:40 AM, Ankit Singh ask9092516...@gmail.comwrote: is output is depend on no of digits in a number like 123 example for odd no of digits and 121224 example for even digits??? can you make

Re: [algogeeks] INTRVIEW QUESTION

2012-08-12 Thread Ankit Singh
, 2012 at 12:44 AM, Ankit Singh ask9092516...@gmail.comwrote: if i am correctly understand the problem den i hv attchd the solution.. On Sun, Aug 12, 2012 at 12:40 AM, Ankit Singh ask9092516...@gmail.comwrote: is output is depend on no of digits in a number like 123 example for odd

[algogeeks] Any body have idea about samsung india recruitment...

2011-08-18 Thread Ankit singh
hi, is there any1 who appeared for samsung india,i want to know what type of questions asked in the written test and interview.and please also tell that what was the eligibility criteria for written test.the company will be coming on 24 in our college. friends please reply... Ankit Singh IIITM

Re: [algogeeks] Re: Any body have idea about samsung india recruitment...

2011-08-18 Thread Ankit singh
thanks *Ankit Singh * On Thu, Aug 18, 2011 at 4:51 PM, DheerajSharma dheerajsharma1...@gmail.comwrote: samsung SISO would be coming day after tomm. in our collg..would tell u the details..howevel..samsung SEL visited..our collg few dayz..back..there was first an aptitude paper..having

Re: [algogeeks] Duplicate in an array

2010-10-06 Thread Ankit Singh
keep inserting the values as key in a hashmap where corresponding value represents no of occurrence of key. Break if count ==2. Time O(n) . -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] Re: Subsequence

2010-08-30 Thread Ankit Singh
Does not work with negative nos. @ Yan Wang,@Adam it worked for ur inputs. With the input like a= {10,0,0,0}, k = 2 it will give 0, 0 as output. -Code- import java.util.ArrayList; import java.util.Collections; import java.util.List; public class NondecreasingMaxsum { // With

Re: [algogeeks] Maximum size binary search tree

2010-08-15 Thread Ankit Singh
First do a level order traversal.Let the result of level order traversal be stored in a list l (ListTree l = new ArrayListTree). Then we can do similar to level order once again.There will be two loops. Outer loop will take an element from list l and treat it as root and the inner loop will do

Re: [algogeeks] Maximum size binary search tree

2010-08-15 Thread Ankit Singh
Space complexity- O(n), Time - O(n2). -- 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 algogeeks+unsubscr...@googlegroups.com. For

Re: [algogeeks] Finding the middle of a singly linked list which has a cycle in it

2010-03-27 Thread Ankit Singh
Hi, This one is rather easy.Same approach can be taken here what applies to non circular linked list. 1. Take a single pointer and a counter. Increment the counter till the next of pointer points to head of circular linked list. Reset the temp pointer to head and increment it to counter/2 +