CSCA48H3 Lecture Notes - Lecture 9: Binary Tree, Tree Traversal, Data Structure
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.