The number of swapping needed to sort numbers 8,22,7,9,31,19,5,13 in ascending order using bubble sort is ?
11
12
13
14
Answers
Answered by
18
Answer:
10
Explanation:
Missing option in question - 10
1 -> 8, 7, 9, 22, 5, 13, 31 -> This will take 4 swaps
2 -> 7, 8, 9, 5, 13, 22, 31 -> This will take 3 swaps
3 -> 7, 8, 5, 9, 13, 22, 31 -> This will take 1 swap
4 -> 7, 5, 8, 9, 13, 22, 31 -> This will take 1 swap
5 -> 5, 7, 8, 9, 13, 22, 31 -> This will take 1 swap
Answered by
22
Answer: The correct answer to this question is the option “D”, and it is ’14.” Bubble sorting is the simplest form of sorting algorithm where adjacent pairs are compared and repeatedly swapped to get the right order. He efficacy is increased in this sorting where the algorithm is maintained. In this case, it is ascending order. It sorts and swaps the numbers individually until the correct sequence as per desire is got.
Similar questions