Code Snippets
These are a collection of code snippets I have used in the past and saved.
Single recoverable worker
A go worker pattern with a single recoverable worker.
Dijkstra's algorithm
A simple implementation of single-source shortest path using Dijkstra's algorithm
Fibonacci
Simple python fibonacci sequence generator
Quick sort
A simple implementation of quick sort algorithm in Go
Heap's Permutation
Heap's Permutation algorithm written in Generator pattern
Recoverable worker pool
A go worker pool pattern with multiple recoverable workers.
Kruskal's algorithm for MST
A simple implementation of minimum spanning tree based on Kruskal's algorithm
Merge sort
A simple implementation of merge sort algorithm in Go
Linked list
A simple implementation of a linked list using Go Generics
Insetion sort
A simple implementation of insertion sort algorithm in Go
Heap structure
A simple implementation of heap structure using generics
DFS
A simple implementation of DFS based on linked list representation of graphs
Counting sort
A sorting algorithm for when entries are bounded integers
Cassandra setup
A bare minimun docker compose file for single node Cassandra and its client
Binary search
A simple implementation of binary search algorithm using Go Generics
Binary Search Tree
A simple implementation of binary search tree data structure using Go Generics
Matrix-based BFS
A simple implementation of BFS based on matrix representation of graphs
Linked list BFS
A simple implementation of BFS based on linked list representation of graphs