Implementacja szukania

This commit is contained in:
2023-05-10 14:21:10 +02:00
parent 6a6a1ec86e
commit 5f369d92f6

View File

@@ -52,6 +52,14 @@ bool hash_al_wstaw(int * A, int m, int x)
return false;
}
bool hash_al_szukaj(int x, int m, int * A){
for (int i = 0; i < m; i++) {
int k = h(x, i, m);
if (A[k] == x){ return true;}
if (A[k] == EMPTY){ return false;}
}
return false;
}
int main()
{
@@ -156,9 +164,13 @@ int main()
std::chrono::duration<double, std::micro> czas = stop - start;
std::cerr << "Uplynelo: " << czas.count() << " us\n";
std::cerr << "Ilość wywołań funkcji wstawiającej: " << g_counter << "\n";
}
//...
return 0;
}