in Algorithms edited by
7,801 views
9 votes
9 votes

The number of swappings needed to sort the numbers $8 , 22, 7, 9, 31, 5, 13$ in ascending order using bubble sort is

  1. $11$
  2. $12$
  3. $13$
  4. $10$
in Algorithms edited by
by
7.8k views

1 comment

answer to this question is 10
0
0

5 Answers

16 votes
16 votes
Best answer
Answer is 10. All swaps are in following order:

8,7,22,9,31,5,13

8,7,9,22,31,5,13

8,7,9,22,5,31,13

8,7,9,22,5,13,31

7,8,9,22,5,13,31

7,8,9,5,22,13,31

7,8,9,5,13,22,31

7,8,5,9,13,22,31

7,5,8,9,13,22,31

5,7,8,9,13,22,31

1 comment

thanks for posting earlier otherwise i have to work on it again.
0
0
5 votes
5 votes
if we try to simulate the array with given elements then number of swappings by applying Bubble sort  =10
3 votes
3 votes
by

1 comment

thx a lot
0
0
0 votes
0 votes
d....

4 Comments

hope you got.
0
0
14 but not in the list
0
0
edited by

ANSWER is 10. 

1
1
Answer:

Related questions