Skip to content

Instantly share code, notes, and snippets.

@iamvon
Created June 8, 2018 08:38
Show Gist options
  • Select an option

  • Save iamvon/7801548bb1727e47b6d0dd701e728104 to your computer and use it in GitHub Desktop.

Select an option

Save iamvon/7801548bb1727e47b6d0dd701e728104 to your computer and use it in GitHub Desktop.
Node* addFirst(Node *head, int value) {
Node *addElement = new Node;
addElement->value = value;
if(head == NULL) head = addElement;
else {
addElement->nextNode = head;
head = addElement;
}
return head;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment