Created
May 13, 2020 12:20
-
-
Save amitk/807bae11617ebc1e75c36693c928e072 to your computer and use it in GitHub Desktop.
A simple linked list in go
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
package main | |
import ( | |
"fmt" | |
) | |
type Node struct { | |
data int | |
next *Node | |
} | |
func main() { | |
var head Node | |
var tail Node | |
head.data = 10; | |
tail.data = 20; | |
head.next = &tail; | |
fmt.Println("head Node: ", head, "\nTail Node: ", tail); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment