Skip to content

Instantly share code, notes, and snippets.

@AahanSingh
Last active Jun 27, 2021
Embed
What would you like to do?
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