Skip to content

Instantly share code, notes, and snippets.

@AahanSingh
Created July 4, 2021 07:29
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 AahanSingh/c02fc43a79461e4ac56d398c8b4027e3 to your computer and use it in GitHub Desktop.
Save AahanSingh/c02fc43a79461e4ac56d398c8b4027e3 to your computer and use it in GitHub Desktop.
CList DeleteList
func DeleteList(head **Node) {
fmt.Println("\nDeleting entire linkedlist")
var aux *Node
for *head != nil {
aux = (*head).Next
if aux == *head || aux == nil {
*head = nil
return
}
(*head).Next = nil
*head = aux
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment