Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,197,896 members, 7,966,338 topics. Date: Friday, 04 October 2024 at 12:51 PM |
Nairaland Forum / Science/Technology / Programming / HELP! If You Are Into C/C++ Programming, Come In! (485 Views)
The Future Of C++ Programming Language– Is It Still Among The Trends? / Do You Want To Learn Programming, Come In Here / C Programming Assignment Help ? (2) (3) (4)
HELP! If You Are Into C/C++ Programming, Come In! by Ikechukwu183: 6:57pm On Mar 31, 2022 |
Please, I need a code to print all possible arrangement (permutation) of the combination of an array (of 'k' elements), i.e. the permutation of the result of combination. For clarity of purpose, let's say the array has the following elements (k=4): "alpha", "beta", "gamma", "delta". Then, for the combination, we choose r=3 After which permutation is carried out. [For better understanding, the result of the combination is put in UPPERCASE, while the unique result of permutation is in lowercase] The expected result is as follows:
From the result above, all unique PERMUTATON of the COMBINATION for r=3 from the array of k=4 elements is completed. This is confirmed since 4C3 x 3! = 24 lines of results On my own I have been able to get separate codes for permutation and combination, but I can only utilize them MANUALLY as I have to keep substituting the elements of the array of the permutation code with results from the combination code. Please, I need someone to combine the two codes below into one code and let it work to produce results like the example above. COMBINATION CODE:
PERMUTATION CODE: #include <bits/stdc++.h> PLEASE, I need help! |
Re: HELP! If You Are Into C/C++ Programming, Come In! by Ikechukwu183: 6:59pm On Mar 31, 2022 |
I know it's a long read, but I appreciate your patience. |
Re: HELP! If You Are Into C/C++ Programming, Come In! by Ikechukwu183: 7:05pm On Mar 31, 2022 |
Also, I will be gifting anyone that helps me arrange the code with N1,000 in recharge card or cash transfer, first. Just to show my appreciation |
Re: HELP! If You Are Into C/C++ Programming, Come In! by Kvngfrosh(m): 7:44pm On Mar 31, 2022 |
Take it to stack overflow |
Re: HELP! If You Are Into C/C++ Programming, Come In! by Ikechukwu183: 8:07pm On Mar 31, 2022 |
Kvngfrosh: I have taken it there but they are not willing to help. I believe their programmers are a bit arrogant. Well, I don't really blame them, they just feel it's too simple so they won't answer it. But they don't realize that everyone is not at the same level. 1 Like |
Re: HELP! If You Are Into C/C++ Programming, Come In! by Deicide: 8:57pm On Apr 02, 2022 |
C++ has a function next_premutation() use it. |
(1) (Reply)
How Do I Convert US CST To Nigerian Time / Username Change / Professional Python Data Analyst and Backend Developers
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 17 |