1. The number of swappings needed to sort the numbers: 8, 22, 7, 9, 31, 19, 5, 13 in ascending order using bubble sort is— (a) 11 (b) 12 (c) 13 (d) 14 I know how to solve it using straightforward method. What I did was to write every pass and check the swappings. But , it takes too much time. Is there any shortcut possible ?

asked
Aug 2, 2015
in Algorithms
worst_engineer
23.5k views