1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-07 22:22:29 +08:00

docs: add IsFull function for ArrayQueue

This commit is contained in:
dudaodong
2022-06-05 16:46:01 +08:00
parent dbca2f6be4
commit d54f27d9a9

View File

@@ -32,6 +32,7 @@ import (
- [Back](#ArrayQueue_Back)
- [Front](#ArrayQueue_Size)
- [IsEmpty](#ArrayQueue_IsEmpty)
- [IsFull](#ArrayQueue_IsFull)
- [Clear](#ArrayQueue_Clear)
- [Contain](#ArrayQueue_Contain)
@@ -307,6 +308,38 @@ func main() {
### <span id="ArrayQueue_IsFull">IsFull</span>
<p>Check if queue is full or not</p>
<b>Signature:</b>
```go
func (q *ArrayQueue[T]) IsFull() bool
```
<b>Example:</b>
```go
package main
import (
"fmt"
queue "github.com/duke-git/lancet/v2/datastructure/queue"
)
func main() {
q := queue.NewArrayQueue[int](3)
fmt.Println(q.IsFull()) // false
q.Enqueue(1)
q.Enqueue(2)
q.Enqueue(3)
fmt.Println(q.IsFull()) // true
}
```
### <span id="ArrayQueue_Clear">Clear</span>
<p>Clean all data in queue</p>