click below
click below
Normal Size Small Size show me how
Trees
| Question | Answer |
|---|---|
| A binary tree is either ___ or it has a special node called the ___ node. | empty root |
| If the tree is nonempty, the root node may have up to two sets of nodes, called the left and right subtrees, such that the left and right subtrees are also ___ trees. | binary |
| The node of a binary tree has ___ links to the descendant nodes in the tree. | two |
| A node in the binary tree is called a ___ if it has no left and right children. | leaf |
| The ___ of a path in a binary tree is the number of branches (edges) on that path. | length |
| The ___ of a node in a binary tree is the number of branches (edges) on the path from the root to the node. | level |
| The level of the root node of a binary tree is ___, and the level of the children of the root node is ___ | 0, 1 |
| The height of a binary tree is the number of nodes on the ___ path from the root to a leaf. | longest |
| In an ___ traversal, the binary tree is traversed as follows: • Traverse the left subtree • Visit the node • Traverse the right subtree | inorder |
| In a ___ traversal, the binary tree is traversed as follows: • Visit the node • Traverse the left subtree • Traverse the right subtree | preorder |
| In a ___ traversal, the binary tree is traversed as follows: • Traverse the left subtree • Traverse the right subtree • Visit the node | postorder |
| Bi Search Tree T is either empty or •has special node called _ node •has 2 sets of nodes LT&RT called _ subtree & __ subtree of T • Key in root node is __ than every key in the l subtree & __ than every key in the r subtree& • LT&RT are __ search trees | root, left, right, larger, smaller, binary |