Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #pragma once
  2.  
  3. template <typename typo>
  4. class node {
  5.  
  6. template <typename typo>
  7. friend class list;
  8. template <typename typo>
  9. friend class queue;
  10.  
  11. private:
  12. typo element; // przechowuje wartosc
  13. node <typo> *next; // wskaznik na nastepny element
  14.  
  15. public:
  16.  
  17. node() {}
  18. ~node() {}
  19.  
  20. /* zwraca element*/
  21. typo getElement() {
  22. return element;
  23. }
  24. /* zwraca wskaznik na nastepny element*/
  25. node getNext() {
  26. return next;
  27. }
  28. /* przypisuje nowa wartosc*/
  29. void setElement(typo newElement) {
  30. element = newElement;
  31. }
  32. /* przypisuje inny element*/
  33. void setNext(node <typo> newNode) {
  34. next = newNode;
  35. }
  36. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement