Skip to content

Instantly share code, notes, and snippets.

@honux77
Last active August 29, 2015 14:26
Show Gist options
  • Select an option

  • Save honux77/8a25410e5d1043021b42 to your computer and use it in GitHub Desktop.

Select an option

Save honux77/8a25410e5d1043021b42 to your computer and use it in GitHub Desktop.
NodeInsert.cpp
Node* Insert(Node *head,int data)
{
Node *node = head;
Node *newNode = new Node();
newNode->data = data;
newNode->next = NULL;
if (node == NULL)
return newNode;
while (node->next)
node = node->next;
node->next = newNode;
return head;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment