Skip to content

Instantly share code, notes, and snippets.

@AahanSingh
Last active June 27, 2021 06:52
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/13fc68bf13a4be08bc1ad3450dfaf971 to your computer and use it in GitHub Desktop.
Save AahanSingh/13fc68bf13a4be08bc1ad3450dfaf971 to your computer and use it in GitHub Desktop.
Length of linked list
func Length(head *Node) int {
len := 0
for ; head != nil; head = head.Next {
len++
}
fmt.Println("Length = ", len)
return len
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment