What is the worst-case space complexity of Insertion Sort?
O(log n)
O(n log n)
O(1)
O(n)
Sorting algorithms can be broadly classified into two categories. What are they?
Recursive and Iterative
Stable and Unstable
Comparison-based and Non-comparison-based
In-place and Out-of-place
Which algorithm repeatedly finds the minimum element from the unsorted part and puts it at the beginning?
Quick Sort
Selection Sort
Merge Sort
Bubble Sort
Which sorting algorithm is generally considered more efficient for small datasets?
It depends on the data distribution
They have the same efficiency
Which of the following is NOT a valid reason for using sorting algorithms?
Improving the performance of searching algorithms.
Finding the median of a dataset.
Compressing files for storage efficiency.
Presenting data in a user-friendly order.
What is a key limitation of both Bubble Sort and Selection Sort?
They have a high space complexity
They are not stable sorting algorithms
They cannot handle arrays with duplicate elements
They are inefficient for large datasets
What is the worst-case time complexity of Selection Sort?
O(n^2)
Which of the following best describes the concept of 'stability' in sorting algorithms?
A stable sorting algorithm maintains the relative order of equal elements.
A stable sorting algorithm is resistant to errors in the input data.
A stable sorting algorithm uses a fixed amount of memory regardless of input size.
A stable sorting algorithm always has the lowest time complexity.
How does Insertion Sort build the sorted portion of the array?
By recursively dividing the array into halves
By finding the minimum element and placing it at the beginning
By iteratively expanding a sorted subarray from left to right
By comparing and swapping adjacent elements
Which statement BEST describes the significance of understanding sorting algorithms?
All sorting algorithms perform equally well, so understanding them is unnecessary.
It enables developers to choose the most suitable algorithm for a given task based on efficiency and data characteristics.
It's primarily a theoretical concept with little practical relevance.
It's only essential for software engineers specializing in algorithm development.