Overview

  • Trees can be considered a special type of graph.
  • They are hierarchical.
  • Because of there hierarchical nature, we often will find recursion useful when working with trees
  • Tress contain rules.  i.e. if N nodes then (N-1) edges.  One edge for each parent – child relationship.

Types of Trees

Trees can be further classified/specialized based on a set of inherent rules or characteristics. Some common types of trees include:

Algorithms

Tree Traversals

Tree traversals deal with different strategies of navigating a tree.

Problems

  • Lowest common ancestor of a binary tree
  • Lowest common ancestor of a binary search tree
  • Serialize and deserialize a binary tree
  • Serialize and deserialize a binary search tree

Leave a Reply

Your email address will not be published. Required fields are marked *