Tree vs. Binary Trees

  • a binary tree in which each node has up to two children. Not all trees are binary trees

Binary Tree vs. Binary Search Tress

  • A binary search tree is a binary tree in which every node fits a specific ordering property: all left <= n <= all right. This must be true for each node n.
  • Usually, no duplication, but need to ask interviewer!

Balanced vs. Unbalanced

  • red-black tree and AVL tree are balanced
  • balanced does not mean perfect binary tree, it means "not terribly imbalanced"

Complete binary tree vs. Full tree

  • a complete binary tree is a binary tree in which every level of the tree is fully filed, except for perhaps the last level.
  • a full binary tree in which every node has either zero or two children

Perfect binary tree:

  • full and complete
  • all leaf node will be at the same level, and this level has the maximum number of nodes

results matching ""

    No results matching ""