Imagine you're sorting a list of strings containing people's names. Would radix sort be a suitable choice for this scenario? Why or why not?

  • Maybe, it depends on the length of the names
  • No, Radix Sort is not suitable
  • Only Merge Sort is suitable
  • Yes, Radix Sort is suitable
Radix sort is not suitable for sorting strings with variable lengths. It operates based on the position of digits, making it more suitable for fixed-length integers. For variable-length strings like names, merge sort would be a better choice, as it doesn't rely on specific positions.
Add your answer
Loading...

Leave a comment

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