Question: ( 1 0 p ) struct node { int data; struct node * leftChild; struct node * rightChild; ) ; a ) ( 5 p

(10p)
struct node {
int data; struct node * leftChild; struct node * rightChild; );
a)(5 p) Write pseudo-code of the algorithm (or C code) to calculate the total number of external nodes in a binary search tree.
int totalExternalNodes(struct node * tree)
b)(5 p) Write a function (C++ code) to print all the data values of nodes in a binary search tree using pre-order walk.
void printPreOrder(struct node * tree)
( 1 0 p ) struct node { int data; struct node *

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 Programming Questions!