Binary Trees Flashcards
What is a full binary tree?
A binary tree where every node has 0 or 2 children
AKA: all nodes except leaf nodes have two children
What is a complete binary tree?
A binary tree where all levels are completely filled except possibly the last and the last level has all nodes as left as possible
What is a perfect binary tree?
A binary tree in which all the parent ndoes have two children and all the leaf nodes are at the same level
What is a balanced binary tree?
If the height of the tree is O(logN) where N is the number of nodes.
What is the time complexity of searching a binary tree
O(H) where H is the height of the tree
What is the time complexity of searching a balanced binary tree
O(logN), which is also the height of a balanced binary tree