Created
December 16, 2019 18:19
-
-
Save rahul4coding/7d99333f3164e42ee2025e36c86c098a to your computer and use it in GitHub Desktop.
Delete node in a Linked List from a specified position
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
function deleteNode(head, position) { | |
if(position==0){ | |
return head.next | |
} | |
head.next = deleteNode(head.next,position-1) | |
return head; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment