I've been working with Node.js and its ecosystem. Now I'm diving deep into Go and I'm getting huge enjoyment from its approach β on one hand, simplicity and no syntactic sugar (you can get diabetes from all the sugar in JS, it's too sweetπ), on the other hand, incredible capabilities and a greater sense of being "close to hardware."
I decided to document my learning notes in an open repo dsa-golang β specifically, implementations of classic algorithms in Go. This isn't production code, but educational examples with comments and Big O complexity analysis.
Sure, there are hundreds of similar repos... so what's the value in opening another one? π
Classic solutions to classic CS problems, without over-engineering or language-specific optimizations, for clear understanding of the algorithm.
Meaningful semantic naming
Aiming for simple and idiomatic Go code
Breakdowns and diagrams right in the comments
What's included:
algorithms/ βββ search/ β βββ Binary β βββ Linear β βββ Jump β βββ BFS Filesystem Β· BFS Graph Queue β βββ DFS Filesystem Β· DFS Graph Recursive Β· DFS Graph Stack βββ selection/ β βββ Quickselect βββ sort/ βββ Bubble βββ Selection βββ Insertion βββ Merge βββ Quick βββ Quick In-Place βββ Heap datastructures/ βββ graph/ βββ Adjacency List leetcode/ βββ Two Sum #1 βββ Merge Sorted Array #88 βββ Valid Palindrome #125 interview_exercises/ βββ Reverse βββ Duplicates βββ Whitespaces βββ Longest informatica/ βββ Factorial βββ Fibonacci βββ Prime βββ Table
I'm planning to expand it by adding data structures and more LeetCode problems.
If you're also learning Go or algorithms β I'd be happy if this helps you and to hear your feedback!
Repository: github.com/AshBuk/dsa-golang
Top comments (4)
@ashbuk Wonderful initiative! Your method of emphasizing deep algorithm understanding and clean, idiomatic Go without the JavaScript sugar rush is very beneficial to students. The repository appears to be an excellent tool for developing that essential "close to the metal" intuition.
Thanks! I plan to expand it and will try to keep it simple.
Interesting! I've been learning Go recently, and I think this could be just the thing for me to get more familiar with DSA in Go! Thanks for this!
Thanks! I hope it really helps! I tried to keep things readable also for people coming from other languages. Though there are Go-specific approaches in there as well, in addition to the classic ones.