What is the primary data structure used in Heap Sort?
Stack
Queue
Linked List
Binary Heap
Which searching technique is most suitable for searching for a target element in a sorted array that is rotated at an unknown pivot point?
Depth First Search
Linear Search
Interpolation Search
Binary Search
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 time complexity in all cases.
Quick Sort has better space complexity than Merge Sort.
Quick Sort is a stable sorting algorithm, while Merge Sort is not.
Interpolation search is most likely to outperform binary search when:
The target element is located near the middle of the array.
The array size is small.
The array is uniformly distributed.
The array is unsorted.
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 uses a fixed amount of memory regardless of the input size.
The algorithm is not affected by the initial order of elements in the array.
The algorithm maintains the relative order of elements with equal values after sorting.
A dynamic array is used to store a growing dataset. When the array reaches its capacity and needs to resize, what is the common strategy to ensure amortized constant time complexity for appending elements?
Increase the array size by a fixed constant when full.
Create a new array with exactly the required size.
Use a linked list instead of resizing the array.
Double the size of the array when full.
What is the main challenge in implementing a circular array?
Managing the wrap-around behavior correctly
Efficiently searching for elements in the array
Determining the starting index of the array
Handling the resizing of the array
Which of the following statements is TRUE about Quick Sort?
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.
It always has a time complexity of O(n log n).
Which data structure is most suitable for implementing a sorted array with efficient insertion and deletion operations?
Array
You are designing a system to store a large sparse matrix where memory usage is critical. Which approach is most suitable?
Implement the sparse matrix using a hash table.
Store the matrix in a text file and read it when needed.
Use a dynamic array and resize it as needed.
Use a standard 2D array.