[algogeeks] Re: How to list all combination of C(n,k)

2007-01-31 Thread Sandesh
recur( start , filled){ if start k then print else { for i=start to n } } On Jan 31, 9:34 pm, sofin [EMAIL PROTECTED] wrote: Hi there, How to write a c program to list all combinations of C(n,k), where 1 = k =n and n is a variable. For example, n=3, C(3,k). k=1, {1},{2},{3}

[algogeeks] Re: How to list all combination of C(n,k)

2007-01-31 Thread Sandesh
recur( start , fill){ if start k then print else { for i=start to n { a[fill] = i recur ( start+1, fill+1) } } } array a, n k are global variables. and call the function as recur(1,1) On Jan 31, 9:57 pm, Sandesh [EMAIL PROTECTED] wrote: recur( start , filled){