Created
June 17, 2020 11:47
-
-
Save vamsitallapudi/183ffce31ddb8b39ce35300b4b4a5941 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def insert_at_end(head, data): | |
new_node = Node(data) | |
current = head | |
while current.next: # traversing till the last node | |
current = current.next | |
# change the next of last node | |
current.next = new_node | |
return head |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment