Space complexity in 10.3 Sort an almost sorted array

#1

Isn’t the space complexity in that example O(n) where n is the number of elements in the sequence? Because we do create a new array ‘result’ where we append the values. If k < len(sequence) the space complexity O(n) right?

0 Likes