Answer to Question #62768 in C++ for Hope
how to use a Factorial Number System for string in c++ ....?
As an example, say we want the 100th permutation of ABCDEF. We write 100 as
0×5!+4×4!+0×3!+2×2!+0×1!0×5!+4×4!+0×3!+2×2!+0×1!
Building up the permutation one letter at a time:
0th element of [ABCDEF] = A
4th element of [BCDEF] = F
0th element of [BCDE] = B
2nd element of [CDE] = E
0th element of [CD] = C
last elemnet = [D]
0
Answer in progress...
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++
Comments
Leave a comment