Question: C problem. Only modify function in file bst.c, but not allowed to modify the function signatures that are currently listed in the file bst.h. This
C problem. Only modify function in file bst.c, but not allowed to modify the function signatures that are currently listed in the file bst.h.





This program performs basic operations on a binary search tree. It reads a sequence of instructions from the standard input stream and outputs the results to the standard output stream. The program accepts the following instructions: add value add the value to the tree min remove and return the smallest value stored in the current tree (should have no effect if the current tree is empty) max remove and return the largest value stored in the current tree (should have no effect if the current tree is empty) print print the values stored in the current tree in order of the inorder traversal; the values should be separated by a single space The main function in problem2.c reads and parses the input stream and calls appropriate functions to perform the instructions. Your task is to implement those functions so that the output produced by the program is correct. Example Input: add park add snow add zoo add car add dinner print min max print add crab add rank add herb add rabbit add sand print max min print min min max max print max min print min print Output: car dinner park snow zoo dinner park snow crab dinner herb park rabbit rank sand snow dinner herb park rabbit rank sand park rabbit (notice that the last two lines of the output are blanks since the tree is empty at that point!). Note: 1. You do not need to implement a balanced binary search tree. 2. You should not modify the code in problem2.c Deliverables: Implementation of the functions in bst.c file. You may add declarations to the file bst.h , but you are not allowed to modify the function signatures that are currently listed in the file bst.h. bst.c 0 0 AW NP #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
