Starting from:

$34.99

COMP9024 Assignment 2 Solution




In this assignment, you will implement a class named ExtendedAVLTree.
ExtendedAVLTree extends the AVLTree class to include the following methods:
• Public static <K, V> AVLTree<K, V> clone(AVLTree<K,V> tree)

For simplicity, we assume that K is int and V is String.

The time complexity of this method must be O(n), where n is the size of the input avl tree. Put your running time analysis as comments after the code.

• public static <K, V> AVLTree<K, V> merge(AVLTree<K,V> tree1, AVLTree<K,V> tree2 )
This class method merges two AVL trees, tree1 and tree2, into a new tree, and destroys tree1 and tree2.


• public static <K, V> void print(AVLTree<K, V> tree)

All the related classes are in the package net-datastructures-4-0. Please download netdatastructures-4-0, install it on your own computer and create the new class ExtendedAVLTree in the same package.

You need to read the code of all the related classes in order to understand how the AVLTree class works.

How to submit?

Follow this link: https://cgi.cse.unsw.edu.au/~give/Student/give.php. Do the following:
1. Use your z-pass to log in.
2. Select current session, COMP9024 and assn2.
3. Submit ExtendedAVLTree.java containing all the code, excluding the code in datastructures-4-0.


Marking

The full mark of this assignment is 10. Marking will be based on the correctness, time efficiency and readability of your code.








References
1. http://docs.oracle.com/javase/tutorial/2d/index.html.
2. http://www.deitel.com/articles/java_tutorials/20050923/IntroductionToJava2D_Page6 .html.
3. http://docs.oracle.com/javase/tutorial/uiswing/components/frame.html.


More products