For sorting a small array of 100 integers that is already mostly sorted, what is the most appropriate algorithm? Justify your choice, explaining its performance characteristics relevant to the given scenario. Focus on Big O notation where appropriate for time and space complexity.
For sorting a list of a million random user records by last name, what is the most appropriate algorithm? Justify your choice, explaining its performance characteristics relevant to the given scenario. Focus on Big O notation where appropriate for time and space complexity.
For finding the median element in a very large, unsorted dataset, what is the most appropriate algorithm? Justify your choice, explaining its performance characteristics relevant to the given scenario. Focus on Big O notation where appropriate for time and space complexity.