0% found this document useful (0 votes)
95 views8 pages

RailRoadCar Rearrangement Iterator

The document describes an algorithm that sorts cars in a track by iteratively moving the car with the highest number to its correct position. It provides a diagram showing the first two iterations of this process, where car 5 is moved to position 1 in the first iteration, and car 6 is moved to position 1 in the second iteration.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
95 views8 pages

RailRoadCar Rearrangement Iterator

The document describes an algorithm that sorts cars in a track by iteratively moving the car with the highest number to its correct position. It provides a diagram showing the first two iterations of this process, where car 5 is moved to position 1 in the first iteration, and car 6 is moved to position 1 in the second iteration.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 8

For each iteration, the car with biggest number is moved the

correct position in the original track. The diagram is given for


the first two iterations

4 5 6 3 1 2

OT

T1
5 6 3 1 2

T2

T3
4

OT

T1
6 3 1 2
T2
4

T3
5

OT

T1
3 1 2

T2
4 5

T3
6

OT
T1
1 2

T2
4 5 3

T3
6

OT

T1
2

T2
4 5 3 1

T3
6
OT

T1

T2
4 5 3 1 2

T3
6

OT
6

T1
4 5 3 1 2

T2

T3
OT
6

T1
5 3 1 2

T2

T3
4

OT
6

T1
3 1 2

T2
4

T3
5
OT
6

T1
1 2

T2
4 3

T3
5

OT
6

T1
2

T2
4 3 1

T3
5
OT
6

T1

T2
4 3 1 2

T3
5

OT
6 5

T1
4 3 1 2

T2
T3

You might also like