Download presentation

Presentation is loading. Please wait.

Published byIsabell Templer Modified over 2 years ago

1
Decision Maths 1 Sorting Algorithms Bubble Sort A V Ali : www.2july-maths.co.uk 1.Start at the beginning of the data set. 2.Compare the first two elements, and if the first is greater than the second, swaps them. 3.Continue doing this for each pair of adjacent elements to the end of the data set. 4.Start again with the first two elements, repeating until no swaps have occurred on the last pass.

2
57 3 12 9 5 Bubble Sort Pass 1 57 31295 57 3 95 55 3 97 55 3 97 55 397

3
55 97 3 Pass 2 55 93127 55 93 7 55 93 7 55 97 3

4
55 93 7 Pass 3 55 97123 55 97 3 53 97 5

5
53 95 7 Pass 4 53 97125 35 97 5

6
35 95 7 Pass 5 35 97125 35 97 5 Sorted !!!

Similar presentations

Presentation is loading. Please wait....

OK

Searching and Sorting Gary Wong.

Searching and Sorting Gary Wong.

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google

Ppt on new delhi tourism Schedule appt online Ppt on human resource management system project Ppt on micro operations of an airport Ppt on traffic light controller using vhdl Present ppt on ipad Ppt on stepping stone to success Ppt on group development definition Presentation ppt on motivational Ppt on working of ac generator