type LinkedList struct {
name string
length int
head *ItemLL
}
type ItemLL struct {
value string
next *ItemLL
}
func (l *LinkedList) Reverse() {
fmt.Println(l.head)
fmt.Println(l.head.next)
fmt.Println(l.head.next.next)
var top *ItemLL
for l.head != nil {
buf := l.head.next
l.head.next = top
top = l.head
l.head = buf
}
}