0 votes 0 votes The algorithm that will efficiently sort an array that is nearly sorted except for the interchange of some adjacent pairs of numbers like $\left \{ 1, 3, 2, 5, 4, 6\right \}$ is : Quick sort Bubble sort Merge sort Selection sort Others ugcnetcse-june2005-paper2 + – go_editor asked Mar 26, 2020 edited Jun 11, 2020 by soujanyareddy13 go_editor 1.3k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes should it be B Sanjay Sharma answered Apr 23, 2016 Sanjay Sharma comment Share Follow See all 3 Comments See all 3 3 Comments reply srestha commented Apr 23, 2016 reply Follow Share why not merge sort? 0 votes 0 votes Sanjay Sharma commented Apr 23, 2016 reply Follow Share since list is nearly sorted so by using bubble sort very few exchanges say 2 or 3 will do the job while for merge sort whole array has to be divided and then again merged in addition to comparison and all 2 votes 2 votes srestha commented Apr 23, 2016 reply Follow Share yes 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes In Bubble sort, we compare the adjacent elements and exchange them if they are not in proper order. Since the given array is almost sorted and we require few exchanges here. so bubble sort is the best choice. Option B is correct here. Hira Thakur answered Feb 15, 2021 Hira Thakur comment Share Follow See all 0 reply Please log in or register to add a comment.