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 8 3 9 2 6 2 8 3 9 4 62 3 8 9 4 6
|
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: -Bubble Sort This sorting algorithm is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in the wrong order. If we have total N elements, then we need to repeat the above process for N-1 times.
Detailed explanation-3: -The selection sort improves on the bubble sort by making only one exchange for every pass through the list.
Detailed explanation-4: -How many passes does an insertion sort algorithm consist of? Explanation: An insertion algorithm consists of N-1 passes when an array of N elements is given.
There is 1 question to complete.