What is the worst-case time complexity of Selection Sort?
O(n)
O(n log n)
O(n^2)
O(log n)
When does Insertion Sort exhibit its worst-case time complexity?
When the array is already sorted
When all elements in the array are the same
When the array has a random distribution of elements
When the array is reverse sorted
Which statement BEST describes the significance of understanding sorting algorithms?
It's primarily a theoretical concept with little practical relevance.
It enables developers to choose the most suitable algorithm for a given task based on efficiency and data characteristics.
All sorting algorithms perform equally well, so understanding them is unnecessary.
It's only essential for software engineers specializing in algorithm development.
What is the primary operation used in Insertion Sort to place an element in its correct position?
Merging
Swapping
Comparison
Shifting
Why are sorting algorithms considered fundamental in computer science?
They are only used in specific niche applications.
They are the basis for more complex algorithms and data structures.
They are primarily used for displaying data to the user.
They are rarely used in modern software development.
Why is Insertion Sort not preferred for large datasets?
It has a high space complexity
It is difficult to implement
It is not a stable sorting algorithm
Its time complexity is quadratic in the worst case
Is Bubble Sort a stable sorting algorithm?
Yes
Stability is irrelevant for Bubble Sort
Only in its optimized version
No
Which of the following is NOT a valid reason for using sorting algorithms?
Compressing files for storage efficiency.
Finding the median of a dataset.
Presenting data in a user-friendly order.
Improving the performance of searching algorithms.
Which algorithm repeatedly finds the minimum element from the unsorted part and puts it at the beginning?
Selection Sort
Quick Sort
Bubble Sort
Merge Sort
Which of the following sorting algorithms has the best-case time complexity of O(n)?
Both Bubble Sort and Selection Sort
Neither Bubble Sort nor Selection Sort