CSCA48H3 Lecture Notes - Lecture 9: Binary Tree, Tree Traversal, Data Structure

76 views2 pages

Document Summary

Each node has pointers to other nodes. A type of tree where each node has at most 2 pointers to other nodes. A binary tree, where for any node: Every node on its left has a value that is less than (or equal) the value in the node itself. Every node on its right has a value that is greater than (or equal to) the value in the node itself. Visit nodes in order of their distance from the root. N, i, o, c, l, s, a, h. Visit each path as deep as possible. Visit each parent node before visiting nodes below. Go all around till we end with the right side. N, i, c, a, h, l, o, s. In our example, the left side is the longest, so start with that side. Visit all nodes below before visiting node itself. A, h, c, l, i, s, o, n.

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