English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I want a C/C++ program that will give the following out put)
The function will be
permutation(int *a, int n, int r)
the output will be a 2D array / pointer to an array that will consist a permutation of r elements chosen from the n elements of array a; (a has n elements)

the function's sample output will be like this:

code:
int a[4] = {1, 2, 3, 4};

permutation(a, 4, 4) results:

1234
1243
1324
1342
1423
1432
.......
4321

permutation (a, 4, 3) results:
123
132
231
213
312
321
412
...
etc



It is a challenging problem. Give me a complete C/C++ source code with example of implementation if you can.

(N.B. Any "Do your homework type answers will be flagged as abuse immediately.)

2006-12-04 02:02:10 · 1 answers · asked by The Potter Boy 3 in Computers & Internet Programming & Design

1 answers

Okay, so DON'T do your homework, I'm still not impressed with this little challenge that you have put forward basically as spam and a sort of backhanded, juvenile "Nyah, nyah" to others that may be newer and less skilled than yourself. On this board, we don't elect teachers to give out assignements and challenges, we try and help each other learn and solve problems. If you want to start a programming contest or challenge group, I bet Yahoo'd let you. Just not here, ok. Oh, yeah, *REPORTED*.

2006-12-05 04:22:18 · answer #1 · answered by Anonymous · 0 1

fedest.com, questions and answers