コード例 #1
0
        private static void MemoryTest()
        {
            Console.WriteLine("Number of items? ");
            int max = int.Parse(Console.ReadLine());

            Console.WriteLine("Tree min order (max = min + 3)?");
            int orderMin = int.Parse(Console.ReadLine());

            TTree <string> root = new TTree <string>(orderMin, orderMin + 3);
            SortedList <string, string> sortedList = new SortedList <string, string>();

            for (int i = 0; i < max; ++i)
            {
                string item = Guid.NewGuid().ToString();
                root.Add(item);

                sortedList.Add(item, item);
            }

            Console.WriteLine("T-Tree root hash code {0}", root.GetHashCode());
            Console.WriteLine("SortedList hash code {0}", sortedList.GetHashCode());

            Console.WriteLine("done, press any key to exit");
            Console.ReadKey();

            sortedList.Add("123", "123");
            root.Add("123");
        }