Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Node {
- public:
- int value;
- Node* next;
- void unshift(){
- }
- void push(){
- }
- void shift(){
- }
- void pop(){
- }
- };
- void output(Node* x){
- if(x != 0){
- cout << (*x).value << " ";
- x = (*x).next;
- output(x);
- }
- cout << endl;
- }
- int main()
- {
- Node a1, a2, a3, a4;
- a1.value = 3;
- a2.value= 8;
- a3.value = 12;
- a4.value = 23;
- a1.next = &a2;
- a2.next = &a3;
- a3.next = &a4;
- a4.next = 0;
- output(&a1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement