# Binary Tree Terminology Linear versus hierarchical data Tree – connected graph with no cycles Child Parent Descendant Sibling Ancestor Leaf vs. internal.

## Presentation on theme: "Binary Tree Terminology Linear versus hierarchical data Tree – connected graph with no cycles Child Parent Descendant Sibling Ancestor Leaf vs. internal."— Presentation transcript:

Binary Tree Terminology Linear versus hierarchical data Tree – connected graph with no cycles Child Parent Descendant Sibling Ancestor Leaf vs. internal node Level Height Binary / K-ary

Binary Tree - More Terminology Full – Theorem: The number of leaf nodes in a non-empty full binary tree is one more than the number of internal nodes – Theorem: The number of pointers in a non-empty binary tree is one more than the number of internal nodes Complete Ordered Skewed Tree

Arithmetic expression tree (8 + 1) * 3 /((9 – 5) + 2) + (0 * (7 – 4) + 6) + + +* + / 81 3- 95 * 2 47 -0 6

Traversals Pre-order – Visit – TravelLeft – TravelRight In-order – TravelLeft – Visit – TravelRight Post-order – TravelLeft – TravelRight – Visit

Pre-order Traversal of expression tree +/*+813+-952+*0-746 + + +* + / 81 3- 95 * 2 47 -0 6

In-order Traversal of expression tree 8+1*3/9-5+2+0*7-4+6 + + +* + / 81 3- 95 * 2 47 -0 6

Post-order Traversal of expression tree 81+3*95-2+/074-*6++ + + +* + / 81 3- 95 * 2 47 -0 6

Download ppt "Binary Tree Terminology Linear versus hierarchical data Tree – connected graph with no cycles Child Parent Descendant Sibling Ancestor Leaf vs. internal."

Similar presentations