Which sorting algorithm has the least space complexity among Merge Sort, Quick Sort, and Heap Sort?
Quick Sort
Heap Sort
Merge Sort
Which of the following is NOT a characteristic of a stable sorting algorithm?
Preserves the order of equal elements.
Can be implemented in both recursive and iterative forms.
Always has a time complexity of O(n log n).
Suitable for sorting objects based on multiple criteria.
Rotating an array by 'k' positions to the right means:
Shifting each element 'k' positions to the right.
Shifting each element 'k' positions to the left.
Reversing the entire array.
Sorting the array in descending order.
What data structure is commonly used to implement a sparse array efficiently?
Hash Table
Linked List
Queue
Binary Tree
What is a key characteristic of a circular array?
It allows direct access to any element in O(1) time.
It has a fixed size that cannot be changed.
It conceptually wraps around, so the last element is followed by the first.
It automatically sorts elements in ascending order.
What is the primary data structure used in Heap Sort?
Binary Heap
Stack
In which scenario is a sparse array particularly useful?
Storing a small array with frequent updates
Representing a matrix with mostly zero values
Storing a large sorted array
Implementing a stack data structure
Quick Sort is generally considered faster than Merge Sort in practice. What is one of the main reasons for this?
Quick Sort typically has smaller constant factors in its time complexity.
Quick Sort has better space complexity than Merge Sort.
Quick Sort has better time complexity in all cases.
Quick Sort is a stable sorting algorithm, while Merge Sort is not.
Which searching technique is most suitable for searching for a target element in a sorted array that is rotated at an unknown pivot point?
Binary Search
Linear Search
Depth First Search
Interpolation Search
What is the time complexity of deleting a given value from an unsorted array in the worst case?
O(n log n)
O(1)
O(log n)
O(n)