Showing posts with label binary search method. Show all posts
Showing posts with label binary search method. Show all posts

Tuesday, 25 February 2020

Ascending Bubble Sort Example

Ascending Bubble Sort:
We can sorting data with bubble sort methods, let's do sorting data with bubble sort methods! This is example for ascending:

The data is:

Record[1][2][3][4][5][6][7][8][9][10]
Data201008010703060904050

Record[1][2][3][4][5][6][7][8][9][10]
Data201008010703060904050
Step 120100801070306090405020 and 100, No Exchange
20100801070306090405020 and 80, No Exchange
20100801070306090405020 and 10, Exchange
10100802070306090405010 and 70, No Exchange
10100802070306090405010 and 30, No Exchange
10100802070306090405010 and 60, No Exchange
10100802070306090405010 and 90, No Exchange
10100802070306090405010 and 40, No Exchange
10100802070306090405010 and 50, No Exchange
Result 1101008020703060904050
Step 2101008020703060904050100 and 80, Exchange
10801002070306090405080 and 20, Exchange
10201008070306090405020 and 70, No Exchange
10201008070306090405020 and 30, No Exchange
10201008070306090405020 and 60, No Exchange
10201008070306090405020 and 90, No Exchange
10201008070306090405020 and 40, No Exchange
10201008070306090405020 and 50, No Exchange
Result 2102010080703060904050
Step 3102010080703060904050100 and 80, Exchange
10208010070306090405080 and 70, Exchange
10207010080306090405070 and 30, Exchange
10203010080706090405030 and 60, No Exchange
10203010080706090405030 and 90, No Exchange
10203010080706090405030 and 40 , No Exchange
10203010080706090405030 and 50, No Exchange
Result 3102030100807060904050
Step 4102030100807060904050100 and 80, Exchange
10203080100706090405080 and 70, Exchange
10203070100806090405070 and 60, Exchange
10203060100807090405060 and 90, No Exchange
10203060100807090405060 and 40, Exchange
10203040100807090605040 and 50, No Exchange
Result 4102030401008070906050
Step 5102030401008070906050100 and 80, Exchange
10203040801007090605080 and 70, Exchange
10203040701008090605070 and 90, No Exchange
10203040701008090605070 and 60, Exchange
10203040601008090705060 and 50, Exchange
Result 5102030405010080907060
Step 6102030405010080907060100 and 80, Exchange
10203040508010090706080 and 90, No Exchange
10203040508010090706080 and 70, Exchange
10203040507010090806070 and 60, Exchange
Result 6102030405060100908070
Step 7102030405060100908070100 and 90, Exchange
10203040506090100807090 and 80, Exchange
10203040506080100907080 and 70, Exchange
Result 7102030405060701009080
Step 8102030405060701009080100 and 90, Exchange
10203040506070901008090 and 80, Exchange
Result 8102030405060708010090
Step 9102030405060708010090100 and 90, Exchange
Result 9102030405060708090100