Skip to content

Instantly share code, notes, and snippets.

@abhi1010
Created June 7, 2014 10:46
Show Gist options
  • Save abhi1010/33be440bf1012773b7e1 to your computer and use it in GitHub Desktop.
Save abhi1010/33be440bf1012773b7e1 to your computer and use it in GitHub Desktop.
Linked List Basic Class
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