[algogeeks] Adove Question.........

2011-07-22 Thread UMESH KUMAR
Hi Given an array of size N that contain some elements, Write a program for finding all possible subset of size R . n i.e. P r Array :[1,2,3,4] n=4,r=3; Output should be: {1,2,3},(1,2,4).{2,3,4},{...} possible 24 sets. Thanks -- You

Re: [algogeeks] Adove Question.........

2011-07-22 Thread Puneet Gautam
@umesh: can R take any value from 1 to 3..? On 7/22/11, UMESH KUMAR kumar.umesh...@gmail.com wrote: Hi Given an array of size N that contain some elements, Write a program for finding all possible subset of size R . n i.e. P r Array :[1,2,3,4] n=4,r=3;

Re: [algogeeks] Adove Question.........

2011-07-22 Thread UMESH KUMAR
yes R is actually size of subset that is always less than or equal to Size of the Array i.e r=n On Thu, Jul 21, 2011 at 11:16 PM, Puneet Gautam puneet.nsi...@gmail.comwrote: @umesh: can R take any value from 1 to 3..? On 7/22/11, UMESH KUMAR kumar.umesh...@gmail.com wrote: Hi Given an

Re: [algogeeks] Adove Question.........

2011-07-22 Thread Piyush Sinha
initial call subset(a,n,r,0,0); printf(%d,count);//to know the value of nPr (no of subsets) * void subset(int a[],int n,int r,int j,int ind) { int i; if(ind==r) { printf({); for(i=0;iind;i++) printf(%d ,a[i]); printf(}\n); count++; }