Answered step by step
Verified Expert Solution
Question
1 Approved Answer
****The language must be in Java. The purpose of the programming questions in this assignment is to evaluate two implementations of binary search trees in
****The language must be in Java.
The purpose of the programming questions in this assignment is to evaluate two implementations of binary search trees in terms of their performance for different insertion and deletion operations. The trees will then be tested to implement a TreeSort sorting algorithm. Binary Search Trees (BST) are data structures that store "items" (such as numbers, names etc.) in memory. They allow fast lookup, addition and removal of items, and can be used to implement either dynamic sets of items, or lookup tables that allow finding an item by its key The Tree interface provides three methods to add and remove elements to and from the tree. It also provides an iterator that visits the elements in-order, as well as a function height that simply returns the height of the tree. Note that the speed of these operations may strongly depend on the implementation In this assignment, you will have to write two implementations of Tree interface (provided), one that uses regular (possibly unbalanced) Binary Search Trees', and one that uses balanced AVL Trees2. After that, you will have to test the performance of TreeSort3 when using your implementations. For your convenience, some starting code is provided. Note that it either does not implement some features or implements them improperly. Question 1: Implement the necessary methods in the two implementations (called A3BSTree and A3AVLTree) of Tree interface: public void add (E e) public void addAll (Collection extends E> c); public boolean remove (Object o) public Iterator
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started