8,233 views
0 votes
0 votes

You are asked to sort 15 randomly generated numbers. You should prefer

A.

bubble sort

B.

Selection sort

C.

Insertion sort

D.

Quick sort


Ans is given as Bubble sort. How it is selected..please explain

1 Answer

0 votes
0 votes

For sorting 15 randomly generated numbers, Insertion sort is considered the best option due to its simplicity, efficiency, and in-place sorting. While Bubble sort, Selection sort, and Heap sort can also sort the numbers, they may not be as efficient as Insertion sort for this specific case. However, the choice of sorting algorithm can depend on various factors such as the nature of the input, the size of the input, and specific requirements of the use case.

Related questions

0 votes
0 votes
3 answers
1
radha gogia asked Sep 16, 2015
2,688 views
To sort n randomly generated numbers. One should prefer which sorting algo ,Quick or Heap?
2 votes
2 votes
2 answers
3
Sahil Gupta asked Nov 25, 2014
1,834 views
You are asked to open one door. There is a large prize behind one of the three doors and the other two doors are losers. After you select a door, Monty Hall opens one of ...