onsider a binary search tree with each node of the type struct node as shown below. struct node { struct node* leftPtr;

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

onsider a binary search tree with each node of the type struct node as shown below. struct node { struct node* leftPtr;

Post by answerhappygod »

onsider a binary search tree with each node of the
type struct node as shown below.
struct node
{
struct node* leftPtr;
int data;
struct node* rightPtr;
}
void Find_Smallest_Non_Leaf_Node_Value(struct node* treePtr,
int* smallest)
Write a recursive C
function Find_Smallest_Non_Leaf_Node_Value that
takes the address of the root node of this binary search tree and
the address of an integer initialized to 0 as input arguments. The
recursive C function should access each node of the binary tree and
detect the smallest value of data member stored in a non-leaf node
(node with at least one child) of the tree. The value should be
stored into the memory location assigned to the
variable smallest upon exiting the function for
the last time. You may assume that the value of all data members in
the tree are greater than 0.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply