Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sanjid133/go-collections
Implement data structure using golang generics
https://github.com/sanjid133/go-collections
data-structures golang
Last synced: about 2 months ago
JSON representation
Implement data structure using golang generics
- Host: GitHub
- URL: https://github.com/sanjid133/go-collections
- Owner: sanjid133
- License: mit
- Created: 2023-02-09T16:06:43.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-09T16:21:35.000Z (almost 2 years ago)
- Last Synced: 2024-06-20T13:34:32.999Z (7 months ago)
- Topics: data-structures, golang
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Implement following data structure using golang generics
- stack
- queue
- set### Stack
A stack is a data structure that follows the LIFO (last in, first out) principle.Implemented methods are:
- Push : add an element to the top of the stack
- Pop : remove the top element from the stack
- Top : return the top element of the stack
- IsEmpty : return true if the stack is empty, false otherwise
- Len : return the number of elements in the stack### Queue
A queue is a data structure that follows the FIFO (first in, first out) principle.Implemented methods are:
- Push : add an element to the back of the queue
- Pop : remove the front element from the queue
- Front : return the front element of the queue
- Back : return the back element of the queue
- IsEmpty : return true if the queue is empty, false otherwise
- Len : return the number of elements in the queue### Set
A set is a data structure that contains a collection of unique elements.Implemented methods are:
- Insert : add an element to the set
- Remove : remove an element from the set
- Contains : return true if the element is in the set, false otherwise
- IsEmpty : return true if the set is empty, false otherwise
- Len : return the number of elements in the set## Installation
To install the package, run the following command:
```
go get github.com/sanjid133/go-collections
```