much101141

Untitled

Apr 21st, 2017
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. #include"NODE.h"
  4.  
  5. #include"LL.h"
  6.  
  7. using namespace std;
  8.  
  9. LL::LL(){
  10.  
  11. hol=NULL;
  12.  
  13. size=0;
  14.  
  15. }
  16.  
  17.  
  18.  
  19. LL::~LL(){
  20. NODE *t=hol;
  21. int i;
  22. for(i=0;i<size;i++)
  23. {
  24. delete t;
  25. t=t->move_next();
  26. }
  27.  
  28. }
  29.  
  30.  
  31.  
  32. void LL::show_all(){
  33.  
  34. NODE* t=hol;
  35.  
  36. int i;
  37.  
  38. for(i=0;i<size;i++){
  39.  
  40. t->show_node();
  41.  
  42. t=t->move_next();
  43.  
  44. }
  45.  
  46. }
  47.  
  48. void LL::add_node(NODE *&A){
  49.  
  50.  
  51.  
  52. hol->insert(A);
  53.  
  54. hol=A;
  55.  
  56.  
  57.  
  58. size++;
  59.  
  60.  
  61.  
  62. }
Add Comment
Please, Sign In to add comment