Skip to content

Commit

Permalink
完善一下
Browse files Browse the repository at this point in the history
  • Loading branch information
dongritengfei committed Mar 17, 2013
1 parent fb26aa3 commit dd09182
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
4 changes: 2 additions & 2 deletions container/ring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

ring包实现了环形双向链表的功能。

## 结构体
函数列表

- type Ring(Ring.md)
- [type Ring](Ring.md)
- [func New(n int) *Ring](New.md)
- [func (r *Ring) Do(f func(interface{}))](Do.md)
- [func (r *Ring) Len() int](Len.md)
Expand Down
32 changes: 32 additions & 0 deletions container/ring/Ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# type Ring

## 结构体代码:

```go

type Ring struct {
next, prev *Ring
Value interface{}
}

```

## 功能说明:

环形双向链表

## 结构体字段:

- `next *Ring`:指向链表中的下一个节点的指针
- `prev *Ring`:指向链表中的上一个节点的指针
- `Value interface{}`: 该节点中存储的内容,可以是任何对象

## 函数链表:

- [func (r *Ring) Do(f func(interface{}))](Do.md)
- [func (r *Ring) Len() int](Len.md)
- [func (r *Ring) Link(s *Ring) *Ring](Link.md)
- [func (r *Ring) Move(n int) *Ring](Move.md)
- [func (r *Ring) Next() *Ring](Next.md)
- [func (r *Ring) Prev() *Ring](Prev.md)
- [func (r *Ring) Unlink(n int) *Ring](Unlink.md)

0 comments on commit dd09182

Please sign in to comment.