Which of the following is NOT a characteristic of a stable sorting algorithm?
Can be implemented in both recursive and iterative forms.
Suitable for sorting objects based on multiple criteria.
Always has a time complexity of O(n log n).
Preserves the order of equal elements.
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?
Bubble Sort
Binary Search
Quick Sort
Linear Search
What is the primary data structure used in Heap Sort?
Binary Heap
Linked List
Stack
Queue
Which of the following algorithms guarantees finding the target element in a sorted array if it exists?
Both Linear Search and Binary Search
Interpolation Search
In which scenario is a sparse array particularly useful?
Storing a large sorted array
Representing a matrix with mostly zero values
Storing a small array with frequent updates
Implementing a stack data structure
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
In which scenario would using Insertion Sort for sorting an array be advantageous?
Sorting an array in reverse order.
Sorting a very large array.
Sorting an array with many duplicate elements.
Sorting an almost sorted array.
Which sorting algorithm has the least space complexity among Merge Sort, Quick Sort, and Heap Sort?
Merge Sort
Heap Sort
Interpolation search is most likely to outperform binary search when:
The array size is small.
The array is unsorted.
The array is uniformly distributed.
The target element is located near the middle of the array.
In the context of searching algorithms, what does the term 'adaptive' refer to?
Algorithms that use divide-and-conquer techniques.
Algorithms that adjust their strategy based on previous search results.
Algorithms that can handle unsorted data.
Algorithms with a constant time complexity.