Objectives: To gain experience with Binary Search Trees and building your own Li
ID: 3766892 • Letter: O
Question
Objectives:
To gain experience with Binary Search Trees and building your own LinkedList.
Documentation:
Explain the purpose of the program as detail as possible - 13%.
Develop a solution for the problem and mention algorithms to be used -16%
List data structures to be used in solution. - 5%.
Give a description of how to use the program and expected input/output - 5%
Explain the purpose of each class you develop in the program. - 5%.
Programming:
For each method, give the pre and post conditions and invariant, if any - 10%
Program execution according to the requirements given 36%
Naming of program as required 5%
Print out of source code 5%
Description of Program
You are to write a program name BSTree.java that will:
Generate 100 random integer numbers ranging from 1 – 99.
Store these numbers in a data structure of your choice and display the data on the screen. DO NOT SORT THIS DATA STRUCTURE.
Now build a Binary Search Tree using this set of numbers. You MUST insert the values into the tree starting from the first element of your Data Structure and go sequentially.
After building the tree, use an infix recursive method to display the data on the screen.
To build the Binary Search Tree, you must create your own Linked List.
Explanation / Answer
#include #include int main() { try { std::vector vec{3,4,3,1}; int i{vec.at(4)}; // Throws an exception, std::out_of_range (indexing for vec is from 0-3 not 1-4) } // An exception handler, catches std::out_of_range, which is thrown by vec.at(4) catch (std::out_of_range& e) { std::cerrRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.