Documentation ¶
Overview ¶
这是一个先进先出队列的包
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue []int
表示队列,队列本身是一个int切片
func (*Queue) Pop ¶
队列的出队方法,将队列的首部第一个元素弹出,方法将返回弹出的值
Example ¶
q := Queue{1, 2, 3} q.Push(4) // 将4压入队列 fmt.Println("origin queue is :", q) fmt.Printf("head first of the queue:%d, has been popped\n", q.Pop()) fmt.Println("the queue after pop action is :", q)
Output: origin queue is : [1 2 3 4] head first of the queue:1, has been popped the queue after pop action is : [2 3 4]
Click to show internal directories.
Click to hide internal directories.