static void Main(string[] args)
        {
            // Sizes for both the sample data and the table itself. (eventually user input)
            const int TableSize = 100;
            const int DataSize  = 1000;

            // Array of random ints. This will be sample data for all hash tables
            int[] arrayOfRandomInts = GetArrayOfRandomInts(DataSize, 100000);

            // Create an empty chaining hash table
            ChainingHashTable chainingHashTable = new ChainingHashTable(TableSize);

            chainingHashTable.Populate(arrayOfRandomInts);
            chainingHashTable.Print();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Insert(9);
            _map.Print();

            Insert(1);
            _map.Print();

            Insert(6);
            _map.Print();

            Insert(6);
            _map.Print();

            Insert(12);
            _map.Print();

            Insert(100);
            _map.Print();

            _map[1] = 1;
            Console.Write("First get: ");
            TimedGet(1);

            _map[1337] = 9001;

            TimedGet(1337);
            Insert(1000);
            TimedGet(1337);
            Insert(10000);
            TimedGet(1337);
            Insert(100000);
            TimedGet(1337);

            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();
        }