{menu} {mirror}



Fundamental Algorithm Analysis

Head Permutations Using a Linear Array of 3 Numbers
EXAMPLE_01 Output where N = 3

Sequence

Output

Indexes Swapped

1

1 2 3

No Swap

2

2 1 3

swapped(0, 1)

3

3 1 2

swapped(0, 2)

4

1 3 2

swapped(0, 1)

5

2 3 1

swapped(0, 2)

6

3 2 1

swapped(0, 1)


Click here to return to EXAMPLE_01.