{"id":20491187,"url":"https://github.com/bgadrian/data-structures","last_synced_at":"2026-01-12T06:54:05.265Z","repository":{"id":57481419,"uuid":"101487413","full_name":"bgadrian/data-structures","owner":"bgadrian","description":"Abstract data structures Go packages, built with performance and concurrency in mind to learn Go.","archived":false,"fork":false,"pushed_at":"2022-12-16T18:35:35.000Z","size":96,"stargazers_count":66,"open_issues_count":1,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-06T15:53:35.075Z","etag":null,"topics":["concurrency","go","golang","learning-golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bgadrian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-26T13:27:45.000Z","updated_at":"2024-07-09T09:50:15.000Z","dependencies_parsed_at":"2023-01-29T15:45:15.034Z","dependency_job_id":null,"html_url":"https://github.com/bgadrian/data-structures","commit_stats":null,"previous_names":["btools/basic-data-and-algorithms"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgadrian%2Fdata-structures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgadrian%2Fdata-structures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgadrian%2Fdata-structures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgadrian%2Fdata-structures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bgadrian","download_url":"https://codeload.github.com/bgadrian/data-structures/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248746691,"owners_count":21155313,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["concurrency","go","golang","learning-golang"],"created_at":"2024-11-15T17:20:21.607Z","updated_at":"2026-01-12T06:54:05.259Z","avatar_url":"https://github.com/bgadrian.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data structures in Go [![Build Status](https://travis-ci.org/bgadrian/data-structures.svg?branch=master)](https://travis-ci.org/bgadrian/data-structures) [![codecov](https://codecov.io/gh/bgadrian/data-structures/branch/master/graph/badge.svg)](https://codecov.io/gh/bgadrian/data-structures) [![Go Report Card](https://goreportcard.com/badge/github.com/bgadrian/data-structures)](https://goreportcard.com/report/github.com/bgadrian/data-structures)\nI am writing a collection of packages for different data structures in GO.\n\nWhy? To learn Go, practice basic structures and learning to code fast concurrent algorithms.\n\nAll the packages have 100+% test coverage, benchmark tests and godocs. Tested with go 1.9.\n\n#### !! Warning This library wasn't used in production (yet). !!\n\n## [priorityqueue](priorityqueue/README.md)  [![GoDoc](https://godoc.org/golang.org/x/tools/cmd/godoc?status.svg)](https://godoc.org/github.com/bgadrian/data-structures/priorityqueue)\nA collection of performant, concurrent safe, complex abstract data structures used for priority queues.\n\n*Priority queue is an abstract data type which is like a regular queue or stack data structure, but where additionally each element has a \"priority\" associated with it. In a priority queue, an element with high priority is served before an element with low priority.*\n\n### [Hierarchical Queue](priorityqueue/README.md) [description](https://www.researchgate.net/figure/261191274_fig1_Figure-1-Simple-queue-a-and-hierarchical-queue-b) \nAn **O(1)/O(1+K) priority queue (very fast)** implementation for small integers, that uses an assembly of N simple queues. It is optimized for large amount of data BUT with small value priorities ( **\u003c= 255** ). Can store any type of elements/values.\n\n### [Hierarchical Heap](priorityqueue/README.md) \n\nIt is a modification of the Hierarchical Queue structure, adding some complexity (O(log n/k)) but removing it's limitations. With the right parameters can be **fast**, only 3-4 times slower than a HQ for 1M elements. Can store any type of elements/values. \n\nInspired by [Cris L. Luengo Hendriks paper](http://www.cb.uu.se/~cris/Documents/Luengo2010a_preprint.pdf)\n\n\n## [heap](heap/README.md) [![GoDoc](https://godoc.org/golang.org/x/tools/cmd/godoc?status.svg)](https://godoc.org/github.com/bgadrian/data-structures/heap)\nA collection of basic abstract heap data structures.\n\n### Implicit Heap [description](http://www.cs.princeton.edu/courses/archive/spr09/cos423/Lectures/i-heaps.pdf) [example](https://www.tutorialspoint.com/data_structures_algorithms/heap_data_structure.htm)\nDynamic Min \u0026 Max Implicit heaps.\nInsert (push) and remove min/max (pop) have ```O(log n)``` complexity. The keys are ```int```and values can be any type ```interface{}```.\n\n## [graph](graph/README.md) [![GoDoc](https://godoc.org/golang.org/x/tools/cmd/godoc?status.svg)](https://godoc.org/github.com/bgadrian/data-structures/graph)\nA collection of simple graph data structures, used for **academic purposes**.\n### AdjacencyList [description](https://en.wikipedia.org/wiki/Adjacency_list)\nAdjacencyList is a collection of unordered lists used to represent a finite graph. The graph is undirected with values on nodes and edges.\nA collection of simple graph data structures, used for **academic purposes**.\n\n### AdjacencyListDirected \nIt is a AdjacencyList with 3 extra functions, that allow 1 direction edge control.\n\n## [tree](tree/README.md) [![GoDoc](https://godoc.org/golang.org/x/tools/cmd/godoc?status.svg)](https://godoc.org/github.com/bgadrian/data-structures/tree)\nPackage tree contains simple Tree implementations for academic purposes.\n\n### BST [description](https://en.wikipedia.org/wiki/Binary_search_tree)\nA basic implementation of a Binary Search Tree with nodes: `key(int), value(interface{})`.\n\n## [linear](linear/README.md) [![GoDoc](https://godoc.org/golang.org/x/tools/cmd/godoc?status.svg)](https://godoc.org/github.com/bgadrian/data-structures/linear)\nA collection of simple linear data structres, that are not in the standard Go lib, built for academic purposes.\n\n### Stack [description](https://www.tutorialspoint.com/data_structures_algorithms/stack_algorithm.htm)\nBasic stack (FILO) using the builtin linked list, can store any type, concurrency safe, no size limit, implements Stringer.\n\n### Queue [description](https://www.tutorialspoint.com/data_structures_algorithms/dsa_queue.htm) \nBasic queue (FIFO) using the builtin linked list, can store any type, concurrency safe (optional mutex), no size limit, implements Stringer.\n\n\n## [Multi-Pivot QuickSort](sort/multipivotquicksort/README.md) [![GoDoc](https://godoc.org/golang.org/x/tools/cmd/godoc?status.svg)](https://godoc.org/github.com/bgadrian/data-structures/sort/multipivotquicksort)\n MultiPivot uses a variant of the QuickSort algorithm with multiple pivots, splitting the arrays in multiple segments (pivots+1). It can be used to sort large arrays.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgadrian%2Fdata-structures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbgadrian%2Fdata-structures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgadrian%2Fdata-structures/lists"}