Reputation: 9809
I read the following statement while comparing heap sort and merge sort:
Merge sort can be adapted to operate on linked lists with O(1) extra space. Heap sort can be adapted to operate on doubly linked lists with only O(1) extra space overhead.
Would appreciate help in explaining this (am not computer science educated) — though I understand the how the above sorts work at an elementary level.
Upvotes: 0
Views: 108
Reputation: 11807
This is a Big O Notation. It is used to describe the complexity (time/memory usage) of an algorithm (check the link for more details). What is meant here is that the algorithms you read about can be extended to work in the mentioned cases and the change needed to be made would result in a constant-more space required. That is the extra space would not depend on the size of the structure. It would be constant - for example one variable more.
EDIT:
Some of the most used notations:
For more details check here
Upvotes: 3