QQ1. Implement and compare time complexity of Merge Sort and Quick Sort for randomly generated arrays of sizes 10 and 50. Display loop counts and timing results to determine efficiency in practice.
- Merge Sort: `O(n log n)` time (all cases), `O(n)` space (auxiliary array).
- Quick Sort: `O(n log n)` average, `O(n²)` worst-case time, `O(log n)` average space.
- Both use Divide and Conquer, but Quick Sort is often faster practically.
- Quick Sort benefits from in-place partitioning and better cache locality.
Answer: Merge Sort and Quick Sort are fundamental comparison-based sorting algorithms taught in courses like BCS-040, both employing the Divide and Conquer paradigm. While their theoretical average-case time complexity is `O(n log n)`, their practical performance can differ due to constant factors, memory access patterns, and worst-case scenarios. This comparison will illustrate their behavior on randomly generated arrays of sizes 10 and 50, focusing on loop counts and execution times. Merge Sort opera...