Page 1 of 1

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

Posted: Mon May 02, 2022 12:17 pm
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.