Implementacja szukania
This commit is contained in:
@@ -52,6 +52,14 @@ bool hash_al_wstaw(int * A, int m, int x)
|
|||||||
return false;
|
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()
|
int main()
|
||||||
{
|
{
|
||||||
@@ -156,9 +164,13 @@ int main()
|
|||||||
std::chrono::duration<double, std::micro> czas = stop - start;
|
std::chrono::duration<double, std::micro> czas = stop - start;
|
||||||
std::cerr << "Uplynelo: " << czas.count() << " us\n";
|
std::cerr << "Uplynelo: " << czas.count() << " us\n";
|
||||||
std::cerr << "Ilość wywołań funkcji wstawiającej: " << g_counter << "\n";
|
std::cerr << "Ilość wywołań funkcji wstawiającej: " << g_counter << "\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//...
|
//...
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user