hashTable

This commit is contained in:
e2hang
2025-08-05 21:36:14 +08:00
parent 0ea4e65fba
commit 07f34fe0bb
2 changed files with 108 additions and 0 deletions

27
Hash/hashArray/main.cpp Normal file
View File

@@ -0,0 +1,27 @@
#include <iostream>
#include "hashTable.h"
using namespace std;
int main() {
hashTable<string, int> table;
table.insert("start", 0);
table.insert("first", 1);
table.insert("second", 2);
table.insert("third", 3);
table.insert("fourth", 4);
table.insert("fifth", 5);
table.insert("sixth", 6);
table.insert("seven", 7);
table.insert("eight", 8);
table.insert("nine", 9);
table.insert("ten", 10);
table.insert("eleven", 11);
table.insert("twelve", 12);
table.insert("Manbo", 13);
cout << table.searchi("first") << " " << table.searchj("first") << endl;
cout << table.searchi("second") << " " << table.searchj("second") << endl;
cout << table.searchi("third") << " " << table.searchj("third") << endl;
cout << table.searchi("Manbo") << " "<< table.searchj("Manbo") << endl;
return 0;
}