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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!