0
votes

Sorry if this is an extremely basic question, but I am fairly new to trees and hence, this doubt bothers me these days.

What is the difference between a binary search tree and a balanced binary search tree? Isn't every BST (Binary search tree) already a BBST (Balanced BST)?

2
See this SO post for a good discussion of balanced binary trees.Tim Biegeleisen

2 Answers

3
votes

"Balanced" is a property that a binary tree may have. It generally means that each node in the tree has approximately the same number of descendant nodes on each subtree underneath it. It more specifically means that the "height" of the tree has been minimized.

For a tree that is not "Balanced", it is possible to have a binary tree where all the "left" child nodes are null, and it still otherwise has the properties of a "binary search tree". This is called a degenerate tree, as it is structurally more like a Linked List, and therefore would have O(N) search time instead of O(log(N)).

0
votes

the difference is that a balance binary tree has the possibly minimum height