Presentation is loading. Please wait.

Presentation is loading. Please wait.

Decision Maths 1 Sorting Algorithm Shuttle Sort A V Ali : www.2july-maths.co.uk 1.Compare items 1 and 2; swap them if necessary 2.Compare 2 and 3; swap.

Similar presentations


Presentation on theme: "Decision Maths 1 Sorting Algorithm Shuttle Sort A V Ali : www.2july-maths.co.uk 1.Compare items 1 and 2; swap them if necessary 2.Compare 2 and 3; swap."— Presentation transcript:

1 Decision Maths 1 Sorting Algorithm Shuttle Sort A V Ali : www.2july-maths.co.uk 1.Compare items 1 and 2; swap them if necessary 2.Compare 2 and 3; swap if necessary; then 1 and 2 again; 3.Compare 3 and 4, then 2 and 3, then 1 and 2; 4.etc. This is an adaption of the Bubble sort, it sorts the sub list fully for each pass.

2 57 31295 Shuttle Sort 57 31295 No sort needed Pass 1

3 Pass 2 57 31295 55 3 97 No sort needed Sort needed

4 Pass 5 55 31297 55 3 97 Sort needed 55 12397 55 793 53 795 Sort needed Pass 4 No sort needed

5 Pass 6 35 12795 Sort needed 35 97125 No sort needed 35 97125 Sorted !!


Download ppt "Decision Maths 1 Sorting Algorithm Shuttle Sort A V Ali : www.2july-maths.co.uk 1.Compare items 1 and 2; swap them if necessary 2.Compare 2 and 3; swap."

Similar presentations


Ads by Google