Consider a scenario where memory usage is critical, and you need to sort a large dataset stored on disk. Discuss the feasibility of using selection sort in this situation and propose an alternative approach if necessary.

  • External Sort
  • Merge Sort
  • Quick Sort
  • Selection Sort
Selection Sort is not feasible in this scenario due to its quadratic time complexity. Instead, External Sort, a class of algorithms designed for large datasets stored on external storage like disks, would be more appropriate. Merge Sort, adapted for external sorting, efficiently manages limited memory usage and minimizes disk I/O operations.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *