Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- template <typename typo>
- class node {
- template <typename typo>
- friend class list;
- template <typename typo>
- friend class queue;
- private:
- typo element; // przechowuje wartosc
- node <typo> *next; // wskaznik na nastepny element
- public:
- node() {}
- ~node() {}
- /* zwraca element*/
- typo getElement() {
- return element;
- }
- /* zwraca wskaznik na nastepny element*/
- node getNext() {
- return next;
- }
- /* przypisuje nowa wartosc*/
- void setElement(typo newElement) {
- element = newElement;
- }
- /* przypisuje inny element*/
- void setNext(node <typo> newNode) {
- next = newNode;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement