Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.46 KB | None | 0 0
  1. #ifndef HACHAGE_STL_H
  2. #define HACHAGE_STL_H
  3. #include "HachageCommun.h"
  4. #include <iostream>
  5. #include <string>
  6. #include <stdexcept>
  7. #include <list>
  8. #include <vector>
  9. using namespace std;
  10. // déclaration des structures de données
  11. struct PersonneSimple
  12. {
  13. string prenom;
  14. string information;
  15. };
  16. struct PersonneTer
  17. {
  18. PersonneSimple unePersonne;
  19. bool libre;
  20. list<PersonneSimple> listeCollisions;
  21. };
  22. struct HachageSTL
  23. {
  24. vector<PersonneTer> donnee;
  25. };
  26. /*----------------------------------------------------
  27. | Méthodes internes à la gestion de la table |
  28. ------------------------------------------------------*/
  29. // entraîne tous les postes de la table sont libres
  30. void initialiserHachageSTL(HachageSTL & table);
  31. // affichage du contennu de la table
  32. void afficher(const HachageSTL & table);
  33. /*----------------------------------------------------
  34. | Méthodes utilisables de la table |
  35. ------------------------------------------------------*/
  36. // test l'existence d'une clef donnée
  37. // appele chercher
  38. bool clefPresente(const HachageSTL & table, const string & clef);
  39. // cherche l'information associée à une clef si elle existe
  40. void chercher(const HachageSTL & table, const string & clef, bool & trouve, string &
  41. information);
  42. // ajoute à la table t, l’information et sa clef
  43. // nécessite non clefPrésente (t, clef)
  44. // déclenche clef déjà présente
  45. void inserer(HachageSTL & table, const string & clef, const string & info)
  46. throw (logic_error);
  47. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement