in Algorithms
590 views
0 votes
0 votes
I'm kind of confused between these two terms as for example - the Auxiliary space of merge sort, heapsort and insertion sort is O(1) whereas Space complexity of merge sort, insertion sort, heapsort is O(n).

So, if someone asks me what's the Space complexity of merge sort, heapsort or insertion sort then what should I tell them O(1) or O(n)?

Also, note in case of selection sort, I've read it's Space Complexity is O(1) which is auxiliary space.

So, is it possible the algorithm which uses "in-place computation" and for those algorithms we mention auxiliary space?

Furthermore I know -

Space Complexity = Auxiliary Space + space taken by also wrt input.

Kindly help, thank you!
in Algorithms
by
590 views

Please log in or register to answer this question.

Related questions