Created
August 15, 2020 14:22
-
-
Save omonimus1/f9a109d7c638670d51d05ba68a6615da to your computer and use it in GitHub Desktop.
Having the values of a new node, set this new node as head of the linked.
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* push_in_head(Node *head, int new_value) | |
{ | |
Node *new_node = new Node(new_value); | |
if(head == NULL) | |
return new_node; | |
else | |
{ | |
new_node->next= head; | |
return new_node; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment