A collection of data structures based on Go 1.18+ Generics.
I basically used an AI to generate the name sture 🗿. But... sture can be interpreted as "structure".
go get github.com/HotPotatoC/sture
Creating a priority queue using:
import "github.com/HotPotatoC/sture/queue"
func main() {
pq := queue.NewPriorityQueue[string]()
pq.Enqueue("Adam", 1)
pq.Enqueue("John", 3)
pq.Enqueue("Bob", 2)
top := pq.Peek()
fmt.Println(top) // John
}
See more examples here
Supported data structures at the moment:
- Binary search tree
- AVL tree
- Linked List
- Queue
- Priority Queue
- Ring Buffer
- Deque
- Stack
- Hash Table
- Chained Hash Table
- more to come...
If this project is helpful to you, please consider supporting me by donating or just give this project a 🌟