Skip to content

hyperf/go-priority-queue

Repository files navigation

Priority Queue for Golang

Test

How to install

go get -u github.com/hyperf/go-priority-queue

How to use

package main

import (
	"fmt"
	q "github.com/hyperf/go-priority-queue"
)

func main() {
	queue := &q.PriorityQueue[string]{}
	queue.Insert("Hyperf", 1)
	queue.Insert("Swoole", 2)
	queue.Insert("Swow", 0)

	fmt.Print(queue.ToArray())
}