Created
June 17, 2020 11:46
-
-
Save vamsitallapudi/98ef4e1e1cea3fe200be6ae5c0a254f2 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
# insertion of new node at front of linked list | |
def insert_at_front(head, data): | |
# creating new node to be inserted | |
new_node = Node(data) | |
new_node.next = head # pointing the new node's next to head | |
head = new_node # making the new node as head | |
return head |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment