Fundamental Algorithm Analysis
Head Permutations Using a Linear Array of 4 Letters
EXAMPLE_01 Output where N = 4
|
Sequence |
Output |
Indexes Swapped |
|
1 |
A B C D |
No Swap |
|
2 |
B A C D |
swapped(0, 1) |
|
3 |
C A B D |
swapped(0, 2) |
|
4 |
A C B D |
swapped(0, 1) |
|
5 |
B C A D |
swapped(0, 2) |
|
6 |
C B A D |
swapped(0, 1) |
|
7 |
C B D A |
swapped(2, 3) |
|
8 |
B C D A |
swapped(0, 1) |
|
9 |
D C B A |
swapped(0, 2) |
|
10 |
C D B A |
swapped(0, 1) |
|
11 |
B D C A |
swapped(0, 2) |
|
12 |
D B C A |
swapped(0, 1) |
|
13 |
D A C B |
swapped(1, 3) |
|
14 |
A D C B |
swapped(0, 1) |
|
15 |
C D A B |
swapped(0, 2) |
|
16 |
D C A B |
swapped(0, 1) |
|
17 |
A C D B |
swapped(0, 2) |
|
18 |
C A D B |
swapped(0, 1) |
|
19 |
B A D C |
swapped(0, 3) |
|
20 |
A B D C |
swapped(0, 1) |
|
21 |
D B A C |
swapped(0, 2) |
|
22 |
B D A C |
swapped(0, 1) |
|
23 |
A D B C |
swapped(0, 2) |
|
24 |
D A B C |
swapped(0, 1) |
Click here to return to EXAMPLE_01 - Alpha.