COMPUTER SCIENCE AND ENGINEERING
ALGORITHMS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
The following lists represent 3 passes of a sorting algorithm. Which algorithm is being used to sort the list?4 5 9 6 2 72 5 9 6 4 72 4 9 6 5 72 4 5 6 9 7
|
Bubble Sort
|
|
Selection Sort
|
|
Insertion Sort
|
|
None of the above
|
Explanation:
Detailed explanation-1: -The algorithms we will cover are: Bubble sort. Selection sort. Merge sort.
Detailed explanation-2: -A bubble sort algorithm goes through a list of data a number of times, comparing two items that are side by side to see which is out of order. It will keep going through the list of data until all the data is sorted into order. Each time the algorithm goes through the list it is called a ‘pass’.
Detailed explanation-3: -Merge Sort Was this answer helpful?
Detailed explanation-4: -The selection sort improves on the bubble sort by making only one exchange for every pass through the list.
There is 1 question to complete.