In what situations is Counting Sort the most efficient?
Counting Sort is best for large datasets with random data, especially when sorting strings or floating-point numbers.
Thatâ€™s partially correct. Counting Sort is efficient with large datasets but is mainly suited for sorting integers or categorical data, not strings or floating-point numbers.
Can you explain why Counting Sort struggles with floating-point numbers or non-integer data?