What is the time and space complexity of your proposed sorting algorithm, and how would you optimize it for a large dataset?