589 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!

Please log in or register to answer this question.

Related questions

2 votes
2 votes
1 answer
1
1 votes
1 votes
2 answers
3
Akash Kumar Roy asked Apr 26, 2018
3,932 views
what is Space complexity of Huffman coding?
3 votes
3 votes
2 answers
4
srestha asked Nov 11, 2017
603 views
Worst case and best case space complexity of merge sort is ___________________________