40 likes | 148 Views
CS-2852 Data Structures. Week 9, Class 1 Hash-code parting remarks Rotations AVL Trees. General Contract for HashCode. Must not change if object doesn’t change If a.equals (b), then a.hashCode () == b.hashCode () If ! a.equals (b), then perhaps a.hashCode () == b.hashCode ()
E N D
CS-2852Data Structures • Week 9, Class 1 • Hash-code parting remarks • Rotations • AVL Trees CS-2852 Dr. Josiah Yoder Slide style: Dr. Hornick
General Contract for HashCode • Must not change if object doesn’t change • If a.equals(b), then a.hashCode() == b.hashCode() • If !a.equals(b), then perhaps a.hashCode() == b.hashCode() But it is better if a.hashCode() != b.hashCode() CS-2852 Dr. Josiah Yoder Slide style: Dr. Hornick
AVL Trees http://www.qmatica.com/DataStructures/Trees/AVL/AVLTree.html Red-black trees http://gauss.ececs.uc.edu/RedBlack/redblack.html (Third Google hit for “red black tree”) CS-2852 Dr. Josiah Yoder Slide style: Dr. Hornick
CS-2852 Dr. Josiah Yoder Slide style: Dr. Hornick