Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Help with planning a recursive function (http://www.go4expert.com/forums/help-planning-recursive-function-t7863/)

ronSSS 16Dec2007 04:18

Help with planning a recursive function
 
Hi ,My name is Ron and I'm new here.

I would very welcome some help with an exercise. Some hints and ideas would be very helpful.

The exercise:

I have 'n' students and 'k' sits ,and I need to build a function (in C) that need to print
all the combinations ,while there are some rules:
* n>=2k-1;
* every two students must be divided by at least one sit;
* I must use an array of STUDENTS[I] , each cell contains only '0' or '1' ;
* the function must be recursive ,and contain no 'FOR' or 'WHILE' loops.

For example, n=5 ,k=2 the output would be :
00101
01001
01010
10001
10010
10100

any hints would be welcomed.

10x and good day.


All times are GMT +5.5. The time now is 04:49.