Asked in
Computer Programming
Database Programming
C Programming

Difference between binary search tree and heap tree?

Answer

User Avatar
Wiki User
October 11, 2010 12:08AM

A binary search tree uses the definition: that for every node,the node to the left of it has a less value(key) and the node to the right of it has a greater value(key).

Where as the heap,being an implementation of a binary tree uses the following definition:

If A and B are nodes, where B is the child node of A,then the value(key) of A must be larger than or equal to the value(key) of B.That is,

key(A) ≥ key(B).