Past exam question: 2066 Bhadra (Regular / Back), Q6(a)
Open in the Padhaiko appQuestion
How can you compare either two sorting or two searching algorithms?
Solution
Criteria for Comparing Sorting or Searching Algorithms:
- Time Complexity: Compare best, average, and worst-case growth rates (, , ) as (e.g., Merge Sort vs. Bubble Sort; Binary Search vs. Sequential Search).
- Space Complexity: Auxiliary memory required (e.g., in-place vs. ).
- Structural Properties: Stability and adaptivity (for sorting), or sortedness requirement (for searching).
Answer:
Sorting or searching algorithms are compared by asymptotic time complexity (best/average/worst cases), auxiliary space complexity, and behavioral properties (such as stability/adaptivity or sorted-input preconditions).