Advertisement
Guest User

function

a guest
Nov 14th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. void addPoint(Point *Tab, int x, int y, bool exist, int k) {
  2. int h = hash_f(k);
  3.  
  4. if (Tab[h].exist == 0) {
  5. Tab[h].x = x;
  6. Tab[h].y = y;
  7. Tab[h].exist = exist;
  8. }
  9. else {
  10. cout << "Обнаружена коллизия!\n";
  11. while (Tab[h].exist == 0) {
  12. h++;
  13. if (Tab[h].exist == 1)
  14. continue;
  15. if (h < 100 & Tab[h].exist == 0) {
  16. Tab[h].x = x;
  17. Tab[h].y = y;
  18. Tab[h].exist = exist;
  19. }
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement