Guest User

Noeud.cpp

a guest
Dec 14th, 2019
93
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "Noeud.h"
  2.  
  3. Noeud::Noeud()
  4. {
  5. }
  6.  
  7.  
  8. Noeud::~Noeud()
  9. {
  10. }
  11.  
  12. Noeud::Noeud(int k, int c, int t, Noeud *p, Noeud *g, Noeud *d, Noeud* pred, Noeud* succ) {
  13. this->k = k;
  14. this->c = c;
  15. this->t = t;
  16. this->p = p;
  17. this->g = g;
  18. this->d = d;
  19. this->pred = pred;
  20. this->succ = succ;
  21. }
  22.  
  23. Noeud::Noeud(int c) {
  24. this->k = 0;
  25. this->c = c;
  26. this->t = 1;
  27. this->p = NULL;
  28. this->g = NULL;
  29. this->d = NULL;
  30. this->pred = NULL;
  31. this->succ = NULL;
  32.  
  33. }
  34.  
  35. void Noeud::setKey(int key) {
  36. this->k = key;
  37. }
  38.  
  39. void Noeud::setParent(Noeud* n) {
  40. this->p = n;
  41. }
  42.  
  43. Noeud* Noeud::getParent() {
  44. return this->p;
  45. }
  46.  
  47. void Noeud::setEnfantGauche(Noeud* n) {
  48. this->g = n;
  49. }
  50.  
  51. Noeud* Noeud::getEnfantGauche() {
  52. return this->g;
  53. }
  54.  
  55. void Noeud::setEnfantDroit(Noeud* n) {
  56. this->d = n;
  57. }
  58.  
  59. Noeud* Noeud::getEnfantDroit() {
  60. return this->d;
  61. }
  62.  
  63. void Noeud::setPredecesseur(Noeud* n) {
  64. this->pred = n;
  65. }
  66.  
  67. Noeud* Noeud::getPredecesseur() {
  68. return this->pred;
  69. }
  70.  
  71. void Noeud::setSuccesseur(Noeud* n) {
  72. this->succ = n;
  73. }
  74.  
  75. Noeud* Noeud::getSuccesseur() {
  76. return this->succ;
  77. }
  78.  
  79. void Noeud::setCouleur(int c) {
  80. this->c = c;
  81. }
  82.  
  83. int Noeud::getCouleur() {
  84. return this->c;
  85. }
RAW Paste Data