-
Notifications
You must be signed in to change notification settings - Fork 16
AVLTree
Kal Ahmed edited this page Sep 26, 2016
·
1 revision
Home > Trees > IBinaryTree > AVLTree
AVLTree is a BinaryTree implementation that implements the standard AVL Tree data structure. An AVL tree is a self balancing binary tree so it ensures that operations are always O(log n).
As with all our examples we assume a tree mapping from strings to integers for simplicity.
Creating an AVLTree can be done in one of two ways:
//Use the default comparer for the key type
AVLTree<String, int> tree = new AVLTree<String, int>();
//Alternatively we can supply a specific comparer for the key type
tree = new AVLTree<String, int>(StringComparer.OrdinalIgnoreCase);All other operations follow the normal ITree API, please see examples there.