Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alonza0314/container-go
This is a module for some useful containers implemented with Golang.
https://github.com/alonza0314/container-go
container golang heap queue set stack
Last synced: 2 days ago
JSON representation
This is a module for some useful containers implemented with Golang.
- Host: GitHub
- URL: https://github.com/alonza0314/container-go
- Owner: Alonza0314
- Created: 2024-05-14T17:13:55.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-05-16T11:13:19.000Z (6 months ago)
- Last Synced: 2024-06-19T11:15:51.927Z (5 months ago)
- Topics: container, golang, heap, queue, set, stack
- Language: Go
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Container-Go
## Version
These containers are coded under golang version:
> go version go1.21.5 linux/amd64.
But I think they can be compiled under all versions.
## Import Containers
Here include these containers
|Type|How to import|Propoties|
|-|-|-|
|Stack|"github.com/Alonza0314/Container-Go/Stack"|Last In, First Out|
|Queue|"github.com/Alonza0314/Container-Go/Queue"|First In, First Out|
|Heap|"github.com/Alonza0314/Container-Go/Heap"|Priority Queue|
|Set|"github.com/Alonza0314/Container-Go/Set"|Unique Element|## Use Containers
Please read the README.md file under their paths.
## Something Important
These containers does not need to specify what kind of data type it contains. They are implemented by interface, so be free to use it with your own creativity.
Also, you can store different data type in the same container.Like:
```go
container := NewContainer()
container.Push(314)
container.Push("Alonza")
container.Push(true)
```But be careful that the container-Heap, which can only store one data type since you need to specify the compare function to define which kind of heap you will use (i.e. minHeap or maxHeap).
---
If there is any problem or confused or have a better way to construct container, feel free to contact me.
Although this is a simple module, but I hope this module can bring a convenient way to code for new "coder".