Data Structures (BCA) 3rd Sem Previous Year Solved Question Paper 2022

Practice Mode:
21.

Which sorting technique is best in terms of complexity ? Justify.

Explanation

Merge sort is often considered one of the best sorting techniques in terms of time complexity. Its time complexity is O(n log n) in the worst case, which is optimal for comparison-based sorting algorithms. This makes merge sort efficient for sorting large datasets. Additionally, merge sort is a stable sort, meaning it preserves the order of equal elements, and it is also suitable for sorting linked lists, which some other sorting algorithms struggle with.