Question: Problem 1017 BST-Create a binary search tree (BST) and output its in-order sequence Middle level) 1: Introduction Problem description and (f any) background of the
Problem 1017 BST-Create a binary search tree (BST) and output its in-order sequence Middle level) 1: Introduction Problem description and (f any) background of the algorithms. Description BST,,BST, ,BST, BST,:,BST (FindMinFindMax) Create a binary search tree (BST) based on the input data by insertion operation, and output the first-order traversal sequence of it. If possible, please also output the minimal element and the maximal element by calling functions Find Min and FindMax, respectively Tips: use insertion operation to create a BST Input: , N, N. (100Ne-10000) We can input many groups of data, where for each group of data inputted in wo lines, First line: the number of elements in the BST tree; Second line: pre-order sequence of the EST; the minimal element and the maximal element Output: , BST BST () Fist line: the number of different elements in the BST Second line: The pre-order Third line: the minimal element and the maximal element (not required in sequence of the BST the website) Sample Input 12 23 324812 Sample Output 2 48 23 32 4 32 2: Algorithm Specification Description (pseudo-code preferred) of all the algorithms involved for solving the problem, including specifications of main data structures. 3: Testing Results Table of test cases. Each test case usnally consists of a brief description of the purpose of this case, the expected result, the actual behavior of your program, the possible cause of a bug if your program does not function as expected, and the current status pass", or "corrected. or "pending") 4: Analysis and Comments Analysis of the time and space complexities of the algorithms. Comments on further possible improvements. Appendix: Source Code (in CiC++)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
