mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-17 03:02:28 +08:00
fmt: gofmt package datastructure/queue
This commit is contained in:
@@ -9,10 +9,10 @@ import (
|
|||||||
// CircularQueue implements circular queue with slice,
|
// CircularQueue implements circular queue with slice,
|
||||||
// last index of CircularQueue don't contain value, so acturl capacity is capacity - 1
|
// last index of CircularQueue don't contain value, so acturl capacity is capacity - 1
|
||||||
type CircularQueue[T any] struct {
|
type CircularQueue[T any] struct {
|
||||||
data []T
|
data []T
|
||||||
front int
|
front int
|
||||||
rear int
|
rear int
|
||||||
capacity int
|
capacity int
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewCircularQueue return a empty CircularQueue pointer
|
// NewCircularQueue return a empty CircularQueue pointer
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ func (q *LinkedQueue[T]) IsEmpty() bool {
|
|||||||
return q.length == 0
|
return q.length == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Enqueue put element into queue
|
// Enqueue put element into queue
|
||||||
func (q *LinkedQueue[T]) Enqueue(value T) {
|
func (q *LinkedQueue[T]) Enqueue(value T) {
|
||||||
newNode := datastructure.NewQueueNode(value)
|
newNode := datastructure.NewQueueNode(value)
|
||||||
|
|||||||
Reference in New Issue
Block a user