- A O(N)
- B O(N log N)
- C O(N^2)
- D O(1)
Time Taken:
Correct Answer:
Wrong Answer:
Percentage: %
Bubble sort has a time complexity of O(N^2), making it inefficient for large datasets. It involves repeated swapping of adjacent elements until the entire list is sorted.
Merge sort has a time complexity of O(N log N), making it a stable and efficient sorting algorithm.
The breadth-first search (BFS) algorithm has a time complexity of O(V + E) in a graph.
The recursive generation of the Fibonacci sequence has an exponential time complexity of O(2^N).
In the worst-case scenario, a hash table may have a time complexity of O(N) for searching an element, depending on collisions and hash function behavior.
Merge sort has a time complexity of O(N log N), making it a stable and efficient sorting algorithm.
Searching an element in a balanced binary search tree has a time complexity of O(log N), where N is the number of nodes.
The time complexity of BFS in a graph is O(V + E), where V is the number of vertices and E is the number of edges.
Radix sort has a time complexity of O(Nk), where N is the number of elements and k is the number of digits in the maximum number.
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.