Tuesday, May 25, 2010

LinkedList C++

#include
using namespace std;

template
struct LinkedListNode {
X nodeData;
struct LinkedListNode *next;
};

template
class LinkedList {
struct LinkedListNode *root;
public:
LinkedList() { cout << this << " Constructor\n"; root = NULL; }
LinkedList(LinkedList &node);
~LinkedList();
LinkedList operator+ (LinkedList &ob2);
LinkedList operator= (LinkedList &ob2);
struct LinkedListNode* getRootNode() { return root; }
void insert(X data);
void disp();
};

No comments:

Post a Comment