会了上一个,这个就差不离了. StackLinkedList.go package StackLinkedList type Node struct { data int next *Node } type Stack struct { top *Node } func (list *Stack) Push(i int) { data := &Node{data: i} if list.top != nil { data.next = list.top } list.top = data } f…
差不多自己看懂了,可以自己写测试了.:) LinkedList.go package LinkedList //"fmt" type Node struct { data int next *Node } type LinkedList struct { head *Node } func (list *LinkedList) InsertFirst(i int) { data := &Node{data: i} if list.head != nil { data.next…