growthmindsit

Trees

Common Terminology

  1. data item

  2. address of left child

  3. address of right child
    • Binary Search Tree : Binary search tree is a data structure that quickly allows us to maintain a sorted list of numbers.
  4. It is called a binary tree because each tree node has a maximum of two children.
  5. It is called a search tree because it can be used to search for the presence of a number in O(log(n)) time.

    The properties that separate a binary search tree from a regular binary tree is

Tree Traversal - inorder, preorder and postorder

raversing a tree allows us to search for a node, print out the contents of a tree, and much more! There are two categories of traversals when it comes to trees:

  1. Depth First
  2. Breadth First

Github view