ECE244H1 Chapter 17: ECE244 Binary Tree
Document Summary
Structure that is either empty or consists of one node connected to two disjoint structure. There are unique parents for each node in the tree except for root. Length of path = numbers of node - 1. Path between the root and each node in the tree is unique. Visiting each node once and only once. There are 6 possibilities but only 3 are useful. Traverse left visit node traverse right. Visit node traverse left traverse right. Traverse left traverse right visit node. Traverse left / traverse right means traverse left subtree or traverse right subtree in the same order. Visit node traverse left traverse right (visit the left subtree first and come back to the right subtree) Binary tree is sorted when using in-order traversal (lnr) (left subtree -> node -> right subtree) Case 1: node is a leaf (just delete the node)