Skip to content

Latest commit

 

History

77 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Awesome Go Data Structures

License: MIT

A hands-on Go learning repository for language fundamentals, data structures, algorithms, concurrency, testing, and engineering practice.

This repository is not just a collection of code snippets. It is a runnable learning path that helps readers move from Go beginner to Go engineering expert. The route starts with language mechanics, continues through data structures and algorithms, and then moves into concurrency, testing, design patterns, Web demos, tooling, and performance awareness.

Project Positioning

  • Build a practical path from Go fundamentals to expert-level engineering habits.
  • Use data structures and algorithms as the training ground for pointers, invariants, tests, and complexity analysis.
  • Borrow navigation ideas from mature learning repositories such as TheAlgorithms/Python, while keeping a Go engineering focus.
  • Keep every major topic connected to code, tests, practice tasks, and next-step guidance.

Who This Is For

Reader Suggested entry
New Go learner Start with BasicGo/ and Beginner to Expert.
Developer from another language Read the Knowledge Graph and skip concepts you already know.
Algorithm learner Start with Linked/, Sorts/, Graph_algo/, and DIRECTORY.md.
Backend engineer Focus on concurrency, context, testing, design patterns, webdemo/, and the Expert Track.

30-Second Quick Start

Requires Go 1.22 or newer.

go vet ./...
go test ./...

Run one topic only:

go test ./BasicGo/pointers
go test ./DoubleLinked -run TestFIFO
go test ./Graph_algo/search

Four-Stage Overview

Stage Goal Recommended modules Completion signal
Stage 1 Beginner Learn syntax, functions, pointers, structs, interfaces, errors, and tests. BasicGo/ You can modify basic examples and write table-driven tests.
Stage 2 Intermediate Understand goroutines, channels, select, context, shared variables, and race thinking. BasicGo/GoRoutine, BasicGo/channelselect, BasicGo/context, BasicGo/sharedvars You can explain data flow and synchronization boundaries.
Stage 3 Advanced Master linked lists, stacks, queues, heaps, trees, graphs, sorting, union-find, Trie, and SkipList. Linked/, Heap/, Graph_algo/, Sorts/ You can test invariants and explain complexity tradeoffs.
Stage 4 Expert Build habits around tests, benchmarks, vet, race detection, modularity, API design, and Web engineering. DesignPatterns/, webdemo/, OSExam/ You can extend modules using a maintainable engineering standard.

See the full route in docs/roadmaps/beginner-to-expert.md.

Textbook Core Spine

The core modules now read like textbook chapters. Each chapter includes goals, prerequisites, a mental model, invariants, operation walkthroughs, complexity derivations, common mistakes, worked examples, exercises, hints, reference answers, and test commands.

Spine area Start here Continue with
Go fundamentals BasicGo Pointers, structs, interfaces, errors, tests, concurrency
Linear structures Linked DoubleLinked, stack, queue, Circular queue
Priority and connectivity Heap Union
Trees and search structures BinarySearch AVL, Red-Black, Segment, Trie, skiplists
Sorting Sorts Benchmarks and stability analysis
Graphs Graph_algo Adjacency, BFS, DFS, Search, Applied problems

Maintainers should follow the Textbook Style Guide when adding or expanding chapters.

Learning Entrypoints

Entrypoint Purpose
Textbook Style Guide Defines the module chapter structure, exercise format, diagrams, complexity notation, and linking rules.
Knowledge Graph Shows prerequisite, practice, and deepening relationships.
Structured Knowledge Data Stable data for future generated pages or visualizations.
DIRECTORY.md TheAlgorithms-style topic directory for the whole repository.
Learning Catalog Difficulty, prerequisites, next topics, and practice tasks.
Go Programming Language Gap Map Maps book chapters to repository stages and modules.
Exercise Matrix Reading, rewrite, test, implementation, benchmark, and refactor tasks.
Expert Track A path from writing Go code to maintaining Go systems.
Contributing Guide Rules for new topics, tests, docs, and knowledge graph updates.

Repository Map

Path Learning content
BasicGo/ Go basics, pointers, concurrency, context, reflection, generics, and low-level layout.
Linked/, DoubleLinked/ Singly linked lists, doubly linked lists, LRU, LFU, and FIFO caches.
stack/, queue/, main/622.go Stack, queue, and circular queue.
BinarySearch/, AVL/, Red-Black/, Segment/ Search trees, balanced trees, and segment trees.
Trie/, skiplists/, Union/, Heap/, Set/ Prefix trees, skip lists, union-find, heaps, and sets.
Sorts/ Bubble, insertion, selection, merge, quick, shell, bucket, and counting sorts.
Graph_algo/ Graph representations, BFS, DFS, paths, cycle detection, bipartite checks, and graph exercises.
DesignPatterns/ Creational, structural, behavioral, and compound design patterns.
OSExam/ FCFS, SJF, priority scheduling, and a file-system skeleton.
webdemo/ Native HTTP, Gin, mini-Gin, and a red-packet demo.

Recommended Learning Loop

  1. Find your current position in the Knowledge Graph.
  2. Pick a stage in Beginner to Expert.
  3. Read the local README and source code for the module.
  4. Run the module tests, for example go test ./Graph_algo/search.
  5. Complete a task from the Exercise Matrix.
  6. Finish with go vet ./... and go test ./....

Quality Bar

Every change should keep these commands green:

go vet ./...
go test ./...

New topics should include:

  • A topic README or equivalent documentation.
  • Table-driven tests.
  • Complexity and core invariant notes.
  • Entries in DIRECTORY.md, docs/catalog.md, and docs/data/knowledge-graph.json.

Roadmap

See ROADMAP.md. Current priorities include generated directory indexes, more benchmarks, go test -race examples, Dependabot vulnerability cleanup, and a stronger expert learning track.

License

MIT. See LICENSE.

About

DataStruct of golang

Topics

Resources

Contributing

Stars

43 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages