Skip to content

Instantly share code, notes, and snippets.

@abdulrahmanAlotaibi
Created December 15, 2022 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abdulrahmanAlotaibi/b000361610327b552cca745cf113d6c9 to your computer and use it in GitHub Desktop.
Save abdulrahmanAlotaibi/b000361610327b552cca745cf113d6c9 to your computer and use it in GitHub Desktop.
Linkedlist: Delete Node in a Linked List
/**
* Definition for singly-linked list.
* type ListNode struct {
* Val int
* Next *ListNode
* }
*/
func deleteNode(node *ListNode) {
node.Val = node.Next.Val
node.Next = node.Next.Next
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment