Recursion is a way to represent the time and space complexity of an algorithm. Every time the first element of array will be sliced, because we have already cheked it for odd or even.
Sort: