You are viewing a single comment's thread. Return to all comments →
go golang solution
func reversePrint(llist *SinglyLinkedListNode) { if llist == nil { return } arr := []int32{} for llist != nil { arr = append([]int32{llist.data}, arr...) llist = llist.next } for _, data := range arr { fmt.Println(data) } }
Seems like cookies are disabled on this browser, please enable them to open this website
Print in Reverse
You are viewing a single comment's thread. Return to all comments →
go golang solution