An open API service indexing awesome lists of open source software.

https://github.com/trviph/collection

Collection is a Go library that aims to implement basic data structures such as List, Queue, Stack, Heap, and more.
https://github.com/trviph/collection

data-structures go golang

Last synced: 4 months ago
JSON representation

Collection is a Go library that aims to implement basic data structures such as List, Queue, Stack, Heap, and more.

Awesome Lists containing this project

README

          

# Collection

[![Go Reference](https://pkg.go.dev/badge/github.com/trviph/collection.svg)](https://pkg.go.dev/github.com/trviph/collection) [![codecov](https://codecov.io/gh/trviph/collection/graph/badge.svg?token=60LBLAG1AT)](https://codecov.io/gh/trviph/collection) [![CI](https://github.com/trviph/collection/actions/workflows/ci.yaml/badge.svg)](https://github.com/trviph/collection/actions/workflows/ci.yaml)

Collection is a Go library that aims to implement basic data structures such as List, Queue, Stack, Heap, and more.

## Data Structures

- [Linked list](https://pkg.go.dev/github.com/trviph/collection#List) is implemented as a doubly linked list.
- [Stack](https://pkg.go.dev/github.com/trviph/collection#Stack) is implemented by using linked list as the base.
- [Queue](https://pkg.go.dev/github.com/trviph/collection#Queue) is implemented by using linked list as the base.
- [Heap](https://pkg.go.dev/github.com/trviph/collection#Queue) is implemented by using [slice](https://go.dev/blog/slices-intro) as the base.

## Caches

- [LRU](https://pkg.go.dev/github.com/trviph/collection/cache#LRU) implemeted cache with LRU eviction policy.
- [MRU](https://pkg.go.dev/github.com/trviph/collection/cache#MRU) implemeted cache with MRU eviction policy.