ECE244H1 Chapter 17: ECE244 Binary Tree

42 views7 pages

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)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers