What is the time complexity of searching for a target value in a sorted array using binary search?
O(n)
O(n log n)
O(1)
O(log n)
Interpolation search is most likely to outperform binary search when:
The target element is located near the middle of the array.
The array is uniformly distributed.
The array is unsorted.
The array size is small.
What is the time complexity of deleting a given value from an unsorted array in the worst case?
Which of the following is NOT a characteristic of a stable sorting algorithm?
Can be implemented in both recursive and iterative forms.
Preserves the order of equal elements.
Always has a time complexity of O(n log n).
Suitable for sorting objects based on multiple criteria.
What data structure is commonly used to implement a sparse array efficiently?
Linked List
Queue
Binary Tree
Hash Table
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?
Create a new array with exactly the required size.
Use a linked list instead of resizing the array.
Increase the array size by a fixed constant when full.
Double the size of the array when full.
What is the main challenge in implementing a circular array?
Efficiently searching for elements in the array
Handling the resizing of the array
Managing the wrap-around behavior correctly
Determining the starting index of the array
In the context of searching algorithms, what does the term 'adaptive' refer to?
Algorithms with a constant time complexity.
Algorithms that use divide-and-conquer techniques.
Algorithms that adjust their strategy based on previous search results.
Algorithms that can handle unsorted data.
What is the time complexity of rotating an array of size 'n' by 'k' positions in place?
O(n*k)
O(k)
Which of the following is NOT a valid approach for array rotation?
Block Swap Algorithm
Juggling Algorithm
Merge Sort Algorithm
Reversal Algorithm