摘要:
package main import ( "container/list" "fmt" ) func main() { l := list.New() //创建一个新的list for i := 0; i < 5; i++ { l.PushBack(i) } for e := l.Front(); 阅读全文
摘要:
package main import ( //"container/list" "fmt" ) //节点 type DNode struct { data interface{} prev *DNode next *DNode } //双向链表 type DList struct { size u 阅读全文
摘要:
package main import ("container/list" "fmt" ) func main(){ link := list.New() // 循环插入到头部 for i := 0; i <= 10; i++ { link.PushBack(i) //向链条中添加元素 } n := 阅读全文