#define CATCH_CONFIG_RUNNER #include "catch.h" #include #include "hashtable.h" #include // Für rand() und srand() #include // Für time() int main() { Catch::Session().run(); // Initialisiere den Zufallsgenerator srand(static_cast(time(0))); int option = 1; while (0 < option && option < 4) { std::cout << "Wählen Sie die Sondierungsmethode : \n1 - linear\n2 - quadratisch\n3 - Doppeltes Hashing\n> "; std::cin >> option; HashTable H(1000, 0.6, option); for (int i = 0; i < 200; ++i) { int randomValue = 1000 + rand() % 501; H.insert(randomValue); } std::cout << "Anzahl der Kollisionen: " << H.getCollisionCount() << std::endl; } system("pause"); return 0; }