1 1 vote What could be the best algorithm from the following when the time complexity is measured based bon the number of swaps performed by the sorting algorithm? 1. Selection sort 2. Insertion sort 3. Bubble sort 4. None of these Algorithms time-complexity sorting + – kallu singh 538 views answer comment Share Follow Print See 1 comment 1 1 comment reply rahul sharma 5 commented Aug 19, 2017 reply Follow flag 1. Selection sort. It does n swaps for n elements to sort where as insertion and bubble can do upto o(n^2) 0 0 replyShare Please log in or register to add a comment.
1 1 vote selection sort max n-1 swap insertion sort max n(n-1)/2 swap bubble sort max n*(n-1)/2 swap sachin! answered Aug 19, 2017 sachin! comment Share Follow 0 reply Please log in or register to add a comment.