MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following is an advantage of a bubble sort?
A
It is a very small and simple computer program
B
It takes a very long time to run
C
It is very quick
D
None of the above
Explanation: 

Detailed explanation-1: -Explanation: Optimised Bubble sort is one of the simplest sorting techniques and perhaps the only advantage it has over other techniques is that it can detect whether the input is already sorted. It is faster than other in case of sorted array and consumes less time to describe whether the input array is sorted or not.

Detailed explanation-2: -The primary advantage of the bubble sort is that it is popular and easy to implement. The main disadvantage of the bubble sort is the fact that it does not deal well with a list containing a huge number of items. In the bubble sort, elements are swapped in place without using additional temporary storage.

Detailed explanation-3: -Because it has to repeatedly cycle through the entire set of elements, comparing only two adjacent items at a time, bubble sort is not optimal for more massive datasets. But it can work well when sorting only a small number of elements.

Detailed explanation-4: -Comparing merge sort to bubble sort An advantage of merge sort over bubble sort is that it is much faster and therefore takes less time to sort large lists and lists that are more unordered. However, bubble sort can actually be quicker than merge sort on smaller lists and lists that are mostly in order.

There is 1 question to complete.