What is the time complexity of merge sort in the worst-case scenario?
- O(log n)
- O(n log n)
- O(n)
- O(n^2)
The time complexity of merge sort in the worst-case scenario is O(n log n), making it an efficient algorithm for sorting large datasets. This complexity arises from its divide-and-conquer approach.
Loading...
Related Quiz
- In BFS, to avoid infinite loops in graphs with cycles, a _______ data structure is used to keep track of visited nodes.
- In radix sort, what is the significance of the "radix" or base value?
- The choice between AVL and red-black trees often depends on the _______ characteristics of the application and the _______ of the operations being performed.
- The space complexity of radix sort is _______ compared to other sorting algorithms like merge sort and quick sort.
- How does the Fibonacci sequence relate to the golden ratio?