Question: Consider a binary tree implemented with a linked structure, and each tree node represents a person and has four fields: name (char[20]), phone (int), leftChild,
Consider a binary tree implemented with a linked structure, and each tree node represents a person and has four fields: name (char[20]), phone (int), leftChild, and rightChild.
Write in C/Java/pseudocode (with sufficient details):
a. struct/class for a treeNode that contains the four fields
b. int getName(treeNode, phone) that returns the name of the tree node with the corresponding phone number. You may assume the phone numbers are unique.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
