A JavaScript collection of classic algorithms and data structures, each with explanations and further reading links.
TheAlgorithms/Go
A collection of classic algorithms and data structures implemented in Go, intended for learning and interview preparation.
- Stars
- 18,236
- Forks
- 2,827
- Open issues
- 10
- Last commit
- 3 months ago
What is it?
This repository is part of TheAlgorithms organization and collects implementations of common algorithms and data structures written in Go. Code is grouped into packages such as sorting, searching, graph algorithms, dynamic programming, math, string processing, ciphers, compression, and data structures like linked lists, heaps, hash maps, deques, and caches.
Each package is meant as an educational reference: functions carry doc comments that explain the approach, complexity, and sometimes links to background material. The project is MIT licensed and accepts community contributions under its contribution guidelines.
It is most useful for developers who want to see how a given algorithm looks in idiomatic Go, or who are working through algorithm questions and want a reference implementation to compare against.
Key features
- 01Covers sorting, searching, graph, and dynamic programming algorithms
- 02Includes data structures such as linked lists, heaps, hash maps, deques, and LRU/LFU caches
- 03Provides math, string, cipher, and compression implementations
- 04Functions include doc comments describing approach and complexity
Use cases
- Studying how classic algorithms are written idiomatically in Go
- Preparing for technical interviews with reference implementations
- Comparing your own solutions against a known implementation
Things to know
- The README describes the implementations as educational, so they are not presented as production-ready libraries.
In collections
Topics
FAQ
- What is Go?
- A collection of classic algorithms and data structures implemented in Go, intended for learning and interview preparation. This repository is part of TheAlgorithms organization and collects implementations of common algorithms and data structures written in Go. Code is grouped into packages such as sorting, searching, graph algorithms, dynamic programming, math, string processing, ciphers, compression, and data structures like linked lists, heaps, hash maps, deques, and caches.
- Is Go free to use? What license does it have?
- Go is open source under the MIT license. Check the license terms before using it in commercial products.
- Is Go still maintained?
- Updated within 6 months. The last commit to Go was on Aug 3, 2026.
- What can I use Go for?
- Studying how classic algorithms are written idiomatically in Go Preparing for technical interviews with reference implementations Comparing your own solutions against a known implementation
- Where can I get Go?
- The source code and installation instructions are on GitHub: https://github.com/TheAlgorithms/Go
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A community-maintained collection of algorithms implemented in Python, intended for learning and education.
A educational collection of algorithms and data structures implemented in C++17 with no external libraries, spanning math, ML, CS and physics.
A collection of classic algorithms and data structures implemented in Java, intended for learning.
A Chinese-language algorithm study guide that teaches LeetCode problems through reusable thinking frameworks rather than bare code solutions.
A free, open-source, illustrated data structures and algorithms textbook with runnable code in more than a dozen programming languages.