Created
July 16, 2017 18:27
-
-
Save amulyagaur/9f22ba4ca4c570ce42f882ad369d333b to your computer and use it in GitHub Desktop.
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
node* InsertAtEnd(node* head,int x) | |
{ | |
node* temp = new node(); | |
temp->data = x; | |
temp->next=NULL; | |
node* temp1 = head; // temporary variable to store the head | |
while(temp1->next!=NULL) | |
temp1 = temp1->next; //iterating to the end of the list | |
temp1->next = temp; | |
return head; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment