DSA-23
DSA-23
Jalgaon
An Autonomous Institute Affiliated to KBCNMU, Jalgaon
Re-accredited by NAAC with “A” Grade & score 3.23 (2nd cycle)
(Approved by AICTE NEW DELHI, Recognized by Govt. of Maharashtra)
Problem Statement
Efficient sorting is critical for tasks such as data searching, inventory management,
and analytics. Traditional sorting algorithms may not perform optimally under
specific conditions, such as:
The goal is to enhance sorting algorithms for scalability, speed, and adaptability.
Challenges
1. Merge Sort:
• Original Behavior: O(n log n) time complexity, requires additional space for
merging.
• Optimization Techniques:
2. Quick Sort:
• Optimization Techniques:
3. Timsort:
• Optimization Techniques:
• Optimization Techniques:
5. Radix Sort:
• Original Behavior: O(nk), where kkk is the digit count of the largest number.
• Optimization Techniques:
Results:
Quick Sort: The optimized version, using median-of-three pivot selection and
hybrid integration with Insertion Sort, provided consistent O(nlogn)O(n \log
n)O(nlogn) performance in practical cases and minimized the risk of hitting
O(n2)O(n^2)O(n2) in the worst case. It proved efficient for large datasets with
diverse patterns.
Merge Sort: Through in-place merging and parallelization, the algorithm reduced
memory usage while maintaining its O(nlogn)O(n \log n)O(nlogn) time
complexity. This made it ideal for very large datasets requiring stable sorting.
Radix Sort: Optimized for numeric or fixed-length data, Radix Sort used memory-
efficient bucket allocation and achieved linear time complexity, significantly
outperforming comparison-based methods for large-scale numeric datasets.