in DS recategorized by
540 views
0 votes
0 votes
What is the difference between the binary-search-tree property and the min-heap property? Can the min-heap property be used to print out the keys of an n-node tree in sorted order in O(n) time?
in DS recategorized by
540 views

1 Answer

2 votes
2 votes

a)http://cs.stackexchange.com/questions/27860/whats-the-difference-between-a-binary-search-tree-and-a-binary-heap

b)No always O(N) time not possible. Because heap is not always a sorted sequence.So for getting sorted sequence we first make it sorted order, which takes minimum O(N log N) time.

edited by