Complete the implementation of the BST.c . There are 6 functions to implement: _
ID: 665887 • Letter: C
Question
Complete the implementation of the BST.c. There are 6 functions to implement:
_createNode
_heightOfSubTree
_addNodeToSubTree
_containsSubTree
_removeLeftMost
_removeNodeFromSubtree
Note that these functions are all private (note the _), and that the public functions which call the private functions have all been written for you.
None of these functions are particularly long, but they can be a bit time consuming to write since they often use recursion to traverse down the tree to an area of interest, then assign returned pointers as function calls return in order to put the tree back together.
FILES YOU WILL NEED:
//BST.h
//BST.c
//type.h
//main.c
ERRATA
The makefile does not link the C library math.h properly, change the lines that read
To read as follows
Note the addition of -lm.
Delete the following lines from main.c:
Explanation / Answer
Output of Program:
It is noted that binary tree figure used at top of article can be referred to under output of program and display of binary tree in pre-order, in-order and post-order forms.