class Node{
public:
int data;
Node * next;
};
class LinkedList{
private:
Node * head;
public:
Node * head;
void insert(int value);
void delete(int value);
void reverse();
};
Note:
No global declarations
Run test the functions in main
Task:
Make a stack with no duplicate elements.
Keeping in mind the above class exists.
class Node{
public:
int data;
Node * next;
};
class LinkedList{
private:
Node * head;
public:
Node * head;
void insert(int value);
void delete(int value);
void reverse();
};
Comments
Leave a comment