Definition

Consists of a collection of nodes (usually storing a value/element) connected by edges to form a hierarchical structure where nodes can have zero or more child nodes, except for a root node with no parent

Important caveats

  • The edges in a tree are typically represented as pointers or references from parent nodes to child nodes
  • The parent/child constraint means there are no cycles (loops)

Main operations

  • add and remove

  • search

  • traverse (access/modify)

  • height, depth

    • Usually implemented via DFS,BFS, recursive operations
  • checkIfExists

  • Optional: set operations, e.g.: union, intersection, difference

Implementation

  • task Include operation details
  • task Most of the page is incomplete