# MCQ IN COMPUTER SCIENCE & ENGINEERING

## 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 6 2 5 7 4 8 6 2 5 7 4 6 8 2 5 7
 A Bubble Sort B Selection Sort C Insertion Sort D 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 least number of comparisons needed to sort (order) five elements is 8.

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.