Documentation ¶
Overview ¶
此文件实现了线程安全一个队列和线程安全一个双链表
Index ¶
- Constants
- type CirCleQueue
- type Deque
- func (s *Deque) Back() interface{}
- func (s *Deque) Capacity() int
- func (q *Deque) Dump()
- func (s *Deque) Empty() bool
- func (s *Deque) Front() interface{}
- func (s *Deque) Full() bool
- func (s *Deque) PopFront() interface{}
- func (s *Deque) PushBack(item interface{}) bool
- func (s *Deque) PushFront(item interface{}) bool
- func (s *Deque) Size() int
- type LinkList
- func (l *LinkList) Clear()
- func (l *LinkList) ForEach(f func(node *ListNode) bool)
- func (l *LinkList) GetAfter(Data interface{}) *ListNode
- func (l *LinkList) GetBefore(Data interface{}) *ListNode
- func (l *LinkList) IsEmpty() bool
- func (l *LinkList) Len() int
- func (l *LinkList) Pop(Data interface{})
- func (l *LinkList) PopFront() interface{}
- func (l *LinkList) PopTail() interface{}
- func (l *LinkList) PushAfter(node *ListNode, inData interface{})
- func (l *LinkList) PushBefore(node *ListNode, inData interface{})
- func (l *LinkList) PushFront(Data interface{})
- func (l *LinkList) PushTail(Data interface{})
- func (l *LinkList) Snapshot() []*ListNode
- func (l *LinkList) String() string
- type ListNode
- type Queue
- func (q *Queue) Clear()
- func (q *Queue) ForEach(f func(node *ListNode) bool)
- func (q *Queue) IsEmpty() bool
- func (q *Queue) Len() int
- func (q *Queue) PopFront() interface{}
- func (q *Queue) PopTail() interface{}
- func (q *Queue) PushFront(Data interface{})
- func (q *Queue) PushTail(Data interface{})
- func (q *Queue) Snapshot() []*ListNode
- func (q *Queue) String() string
Constants ¶
View Source
const CQUEUE_SIZE = 5
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CirCleQueue ¶
SqQueue 结构体定义
func (*CirCleQueue) ForEach ¶
func (c *CirCleQueue) ForEach(f func(data interface{}) bool)
func (*CirCleQueue) Snapshot ¶
func (c *CirCleQueue) Snapshot() []interface{}
type Deque ¶
func (*Deque) PopFront ¶
func (s *Deque) PopFront() interface{}
PopFront: 时间复杂度O(1), 移除队首元素 返回移除的元素。 如果当前队列为空,则返回nil
type LinkList ¶
type LinkList struct { Head *ListNode Tail *ListNode sync.Mutex // contains filtered or unexported fields }
func NewLinkList ¶
func NewLinkList() *LinkList
func (*LinkList) PushBefore ¶
Data1前插入Data2
Click to show internal directories.
Click to hide internal directories.