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.