Package dsa.lab08.exercises
Class AVLTree<Key extends Comparable<Key>,Value> 
java.lang.Object
dsa.lab07.solutions.BinarySearchTree<Key,Value>
 
dsa.lab08.exercises.AVLTree<Key,Value> 
- Type Parameters:
- Key- the key type
- Value- the value type
- All Implemented Interfaces:
- Container<MapItem<Key,,- Value>> - Map<Key,,- Value> - OrderedMap<Key,,- Value> - Iterable<MapItem<Key,- Value>> 
An AVL tree.
- 
Nested Class SummaryNested classes/interfaces inherited from class dsa.lab07.solutions.BinarySearchTreeBinarySearchTree.ItemIterator<Key extends Comparable<Key>,Value>, BinarySearchTree.Node<Key extends Comparable<Key>, Value> 
- 
Field SummaryFields inherited from class dsa.lab07.solutions.BinarySearchTreeroot, size
- 
Constructor SummaryConstructors
- 
Method SummaryMethods inherited from class dsa.lab07.solutions.BinarySearchTreefind, findNode, items, max, min, next, previous, reversed, size, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliteratorMethods inherited from interface dsa.lab04.base.MapcontainsKey, containsValue, get, insert, valuesMethods inherited from interface dsa.lab05.base.OrderedMapkeys, reversedKeys
- 
Constructor Details- 
AVLTreepublic AVLTree()Construct an empty AVL tree.
- 
AVLTreeConstruct an AVL tree containing the given items.- Parameters:
- items- the items
 
- 
AVLTreeConstruct an AVL tree containing the given items.- Parameters:
- items- the items
 
 
- 
- 
Method Details- 
insertDescription copied from interface:MapInsert the given item.If there's already an item with the same key, that item is replaced with this one. This means that if the key was not already contained, the size is incremented, otherwise it isn't. - Specified by:
- insertin interface- Map<Key extends Comparable<Key>,- Value> 
- Overrides:
- insertin class- BinarySearchTree<Key extends Comparable<Key>,- Value> 
- Parameters:
- item- the item
 
- 
removeDescription copied from interface:MapRemove and return the item with the given key.Decrements the size (assuming the item was actually in the map). - Specified by:
- removein interface- Map<Key extends Comparable<Key>,- Value> 
- Overrides:
- removein class- BinarySearchTree<Key extends Comparable<Key>,- Value> 
- Parameters:
- key- the item's key
- Returns:
- the item
- Throws:
- NoSuchElementException- if- keyis not contained
 
- 
_isHeightCacheCorrectpublic boolean _isHeightCacheCorrect()
- 
_isAVLConditionSatisfiedpublic boolean _isAVLConditionSatisfied()
 
-