Skip to content

Instantly share code, notes, and snippets.

@RafaelGSS
Created October 11, 2017 16:47
Show Gist options
  • Select an option

  • Save RafaelGSS/2d6a39db385fef53433e32d0179c2188 to your computer and use it in GitHub Desktop.

Select an option

Save RafaelGSS/2d6a39db385fef53433e32d0179c2188 to your computer and use it in GitHub Desktop.
Simple example List
struct LNode {
int data;
LNode* next;
LNode(int n){data = n; next = NULL;}
void add_to_end(int n) {
if (next)
next->add_to_end(n);
else
next = new LNode(n);
}
~LNode() { delete next; }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment