# asg11 - COP3530 Assignment11 Due:13thNov2009 Q1.AVLtree...

This preview shows pages 1–3. Sign up to view the full content.

COP 3530 Assignment 11 Due: 13 th Nov 2009 Q1 . AVL tree Start with an empty AVL search tree and insert the following keys in the given order: 25, 35, 45, 20, 22, 27. Draw the trees following each insertion, and also after each rotation. Specify the rotation types. You do need to specify the balancing factors. Q2. Binary Search Tree In this problem, you will extend the BinarySearchTree class to support several additional functions. PLEASE put all your solutions in one single java file. Name this file MyBinarySearchTree.java. a) Implement a new method check() , which will check whether the current tree is a binary search tree or not. For example, if MyBinarySearchTree t equals to: then t.check() should return true. But if t equals to: t.check() should return false.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
b) Implement a new method removeLarger(int x) , which will remove all elements larger than x from a given binarySearchTree. For example, if t equals to: After calling t.removeLarger(5) , t should become Note that the worst time complexity of your method must be O(n), where n is
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 01/15/2010 for the course COP 3530 taught by Professor Davis during the Fall '08 term at University of Florida.

### Page1 / 4

asg11 - COP3530 Assignment11 Due:13thNov2009 Q1.AVLtree...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online