- A O(1)
- B O(log N)
- C O(N)
- D O(N^2)
Time Taken:
Correct Answer:
Wrong Answer:
Percentage: %
Binary search in a balanced BST has a time complexity of O(log N) where N is the number of elements. This is due to the logarithmic reduction in the search space with each comparison.
Quicksort exhibits an average time complexity of O(N log N) due to its efficient divide-and-conquer approach.
Merge sort has a time complexity of O(N log N), making it a stable and efficient sorting algorithm.
Radix sort has a time complexity of O(Nk), where k is the maximum number of digits in the input numbers.
Constructing a binary heap has a time complexity of O(N), where N is the number of elements being inserted.
In the best-case scenario, the time complexity of bubble sort is O(N), making it efficient for already sorted lists.
The pop operation in a queue has a constant-time complexity of O(1), making it efficient for removing elements from the front of the queue.
Quicksort has an average-case time complexity of O(N log N), making it efficient for sorting large datasets on average.
The union operation in a disjoint-set with path compression has a time complexity of O(log N), where N is the number of elements.
Counting sort has a time complexity of O(N + k), where N is the number of elements and k is the range of input values.