array_queue_test

  • 2022-12-14
  • 浏览 (483)

array_queue_test.go 源码

package array_queue

import (
	"fmt"
	"testing"
)

func TestArrayQueue(t *testing.T) {
	queue := New(5)

	_ = queue.Enqueue(5)
	_ = queue.Enqueue(1)
	_ = queue.Enqueue(7)
	_ = queue.Enqueue(2)
	_ = queue.Enqueue(6)

	dequeue, _ := queue.Dequeue()
	fmt.Println(dequeue)

	fmt.Println(queue.Size())
	queue.PrintData()

	err := queue.Enqueue(6)
	if err != nil {
		fmt.Println("插入数据出现错误 : ", err)
	}
}

你可能感兴趣的文章

array_queue

0  赞