Question: Java program that creates and processes a binary search tree. Traversal: Pre-order Iask: write a program that creates and processes a binary search tree (DS)
Iask: write a program that creates and processes a binary search tree (DS) (according to the variant, MaxSize -15) and to fulfill thus functions: 1) Create a binary search tree and fill in the binary search tree with whole nodes; 2) output to the binary search tree nodes, with one of the traversal algorithms (see table); 3) Find the binary search tree and output the results on the screen a) how many, leaves" (nodes having no children) are there?; b) how many nodes having one child on the left are there?; c) how many nodes having one child on the right are there? d) how many nodes having two children are there? 4) Carry out the following activities with the binary search tree and output the results: a) find the number of elements that belong to the interval [-10: 10] b) count the pairs of elements in the binary search tree: c) count the elements equal to zero: d) count negative elements in the list
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
