CSCA48H3 Lecture Notes - Lecture 14: If And Only If, Tree Traversal, Branching Factor

132 views11 pages

Document Summary

A tree consists of zero or more nodes -- each of which has zero or more pointers to (smaller) trees. If t1,,tn are trees, and r is a node, then a larger tree can be constructed by setting r"s pointers to point to t1,,tn. In this case, node r is called the root of the tree. The root is the only node in a tree that has no node pointing to it, and every other node has exactly one node pointing to it. If node p points to node c, then c is called a child of p, and p is called the parent of c. Also, t1,,tn are called subtrees of r. A node with no children is called a leaf. For a tree with only one node, that node is both the root and a leaf. A node with one or more children (i. e. , a node that is not a leaf) is called an internal 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

Related Documents

Related Questions