Skip to content

Instantly share code, notes, and snippets.

Last active June 27, 2021 06:50
What would you like to do?
Insert at the start of the list
func InsertAtStart(head **Node, x int) {
tmp := Node{Data: x, Next: nil}
fmt.Println("\nInserting", tmp, "at the start")
if *head == nil {
*head = &tmp
tmp.Next = *head
*head = &tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment