Created
June 7, 2014 10:46
-
-
Save abhi1010/33be440bf1012773b7e1 to your computer and use it in GitHub Desktop.
Linked List Basic Class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node | |
{ | |
Node* next; | |
int data; | |
public: | |
friend class NodeAlgo; | |
~Node(void); | |
Node(int d): next(NULL), data(d) { }; | |
void appendToTail(int d); | |
void printAll(); | |
// Comparisons | |
bool operator<(const Node& node) const; | |
bool cmp (const Node& node1, const Node& node2) const; | |
// Data functions | |
int getData() { return data; } | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment