Chapter 19: Problem 3
A node with no children is called a(n) __________.
Chapter 19: Problem 3
A node with no children is called a(n) __________.
All the tools & learning materials you need for study success - in one app.
Get started for freePropose a definition of a preorder traversal for ternary trees, and give pseudocode for accomplishing such a traversal.
Give an algorithm for a function int smallest (TreeNode *tree) that takes a pointer to a root of a binary search tree as parameter and returns the smallest value stored in the tree.
Give an algorithm for a function int largest (TreeNode *tree) that takes a pointer to a root of a binary search tree as parameter and returns the largest value stored in the tree.
A ternary tree is like a binary tree, except each node in a ternary tree may have three children: a left child, a middle child, and a right child. Write an analogue of the TreeNode declaration that can be used to represent the nodes of a ternary tree.
Give an algorithm for a function void increment (TreeNode *tree) that increments the value in every node of a binary tree by one.
What do you think about this solution?
We value your feedback to improve our textbook solutions.