When analyzing sorting algorithms, why is Merge Sort ($O(n ext{ log } n)$) considered efficient while Bubble Sort ($O(n^2)$) is considered inefficient, even if both are in P?
Answer
Merge Sort matches the known lower bound for comparison-based sorting, while Bubble Sort exceeds it
Efficiency in this context relates to matching the theoretical minimum requirement for the problem; Merge Sort meets the $O(n ext{ log } n)$ lower bound for comparison sorts, whereas Bubble Sort's $O(n^2)$ complexity is slower than that bound.

#Videos
Algorithms Explained: Computational Complexity
Related Questions
What is computational complexity fundamentally concerned with?What are the two primary resources quantified when measuring computational complexity?What does Big O notation provide when describing resource scaling?What is established by the complexity of the problem itself regarding resource requirements?Which abstract model serves as the standard for rigorous mathematical analysis in complexity theory?What characterizes the decision problems belonging to the class P (Polynomial Time)?What is the critical feature defining problems within the class NP?What are NP-complete problems described as within the class NP?Why are problems requiring exponential time complexity ($O(2^n)$) typically deemed intractable?When analyzing sorting algorithms, why is Merge Sort ($O(n ext{ log } n)$) considered efficient while Bubble Sort ($O(n^2)$) is considered inefficient, even if both are in P?In complexity analysis involving very large integers, such as those used in cryptography, what nuance in measurement might become relevant?