-
Notifications
You must be signed in to change notification settings - Fork 16
UnbalancedBinaryTree
Kal Ahmed edited this page Sep 26, 2016
·
1 revision
Home > Trees > IBinaryTree > UnbalancedBinaryTree
As the name suggests an UnbalanceBinaryTree is a BinaryTree implementation which implements an unbalanced binary tree. This means that the tree is never balanced so the order in which items are inserted or deleted from the tree can have a significant effect on lookup performance.
As with all our examples we assume a tree mapping from strings to integers.
An unbalanced tree is relatively simple to create:
//Use the default comparer for the keys
UnbalancedBinaryTree<String, int> tree = new UnbalancedBinaryTree<String, int>();
//Use a custom comparer for the keys
tree = new UnbalancedBinaryTree<String, int>(StringComparer.Ordinal);All other operations follow the standard ITree interface.