- 博客(2)
- 收藏
- 关注
原创 【Golang】单指针实现双链表
如何用单指针实现双链表?要解决这个问题,我们需要一些思维的铺垫,下面分三个步骤,由浅入深地带你实现!正常:实现一个单链表网上单链表的实现非常多,考虑到实用性,设计也不尽相同。下面选一个最直白简单的。show me the codehttps://gist.github.com/RBowind/1561ac542b0c33bbf1da20d47640d80f//Element 单链表每一个节点type Element struct { next *Element //索引下一个节点 V.
2021-09-23 18:33:18
198
原创 【Golang】编译器如何判断你是否是 Duck Type
go version 1.14.12何为 Duck Type当看到一只鸟走起来像鸭子、游泳起来像鸭子、叫起来也像鸭子,那么这只鸟就可以被称为鸭子。 Show me the code ????type Duck interface { Quack()}type Cat struct{}//The Cat implements the Quack() method, now, the Cat is Duck Typefunc (c Cat) Quack() { fmt.Printl
2021-08-28 22:31:39
427
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅