Merge Sort is considered a stable sorting algorithm. What does 'stable' mean in this context?
The algorithm always takes the same amount of time to sort an array of a given size.
The algorithm is not affected by the initial order of elements in the array.
The algorithm uses a fixed amount of memory regardless of the input size.
The algorithm maintains the relative order of elements with equal values after sorting.
Which sorting algorithm would be most suitable for sorting a very large dataset that cannot fit entirely in RAM?
Merge Sort
Heap Sort
Quick Sort
Which sorting algorithm has the least space complexity among Merge Sort, Quick Sort, and Heap Sort?
Which of the following is NOT a valid approach for array rotation?
Merge Sort Algorithm
Juggling Algorithm
Reversal Algorithm
Block Swap Algorithm
What is the time complexity of inserting an element into a Max Heap containing 'n' elements?
O(log n)
O(n log n)
O(n)
O(1)
Quick Sort is generally considered faster than Merge Sort in practice. What is one of the main reasons for this?
Quick Sort has better time complexity in all cases.
Quick Sort typically has smaller constant factors in its time complexity.
Quick Sort has better space complexity than Merge Sort.
Quick Sort is a stable sorting algorithm, while Merge Sort is not.
In which scenario is a sparse array particularly useful?
Storing a small array with frequent updates
Representing a matrix with mostly zero values
Implementing a stack data structure
Storing a large sorted array
Which of the following statements is TRUE about Quick Sort?
It always has a time complexity of O(n log n).
It is a stable sorting algorithm.
It performs poorly on already sorted arrays if the pivot selection is not optimized.
It is generally preferred over Merge Sort for arrays.
What is the time complexity of resizing a dynamic array (like ArrayList in Java or vector in C++) when it becomes full?
You are given a sorted array and a target value to insert. Which algorithm offers the best time complexity for inserting the target value while maintaining the sorted order?
Binary Search
Linear Search
Bubble Sort