License:
AvlDictionary.cs - C# implementation of an AVL tree based generic IDictionaryinterface. Copyright (C) 2009 Peter Graf This file is part of PBL - The Program Base Library. PBL is free software. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For more information on the Program Base Library or Peter Graf, please see: https://www.mission-base.com/.
For the tests I prepared an array of 100000 key-value pairs of type string. The keys were the strings 'k0', 'k1', ... 'k99999' and the values the strings 'v0', 'v1', ... 'v99999'. I used the array for different tests in random, sorted and reversed order.
AvlDirectory needs slightly more than Dictionary and SortedDictionary, SortedList needs less memory.
AvlDirectory is slightly better than SortedDictionary, SortedList really needs a long time.
AvlDirectory is slightly better than SortedDictionary and on par with SortedList.
AvlDirectory is significantly better than SortedDictionary, SortedList really needs a long time.
AvlDirectory is significantly better than SortedDictionary, SortedList really needs a long time.
AvlDirectory is slightly better than SortedDictionary, SortedList really needs a long time.
AvlDirectory is better than SortedDictionary and slightly better than SortedList.
AvlDirectory is better than SortedDictionary and slightly worse than SortedList.
For this O(N) operation AvlDirectory is better than SortedDictionary and worse than SortedList.
Conclusion: I do not understand what the .NET built in type SortedList list is good for at all and I would prefer AvlDirectory over the built in type SortedDictionary. However the built in type Dictionary is either awesome or it cheats with the test outputs :-).