Browser the repo here: https://pkg.go.dev/github.com/lorenzotinfena/goji
- Graph
- Dijkstra
- DFS and BFS
- Heap
- Hashset
- MultiHashSet
- HashMap
- MultiHashMap
- Segment tree
- Lazy segment tree
- HAMT
- Bitset
- LinkedList
- Queue
- Stack
- Tuple
- DP
- Diophantine equations
- Polynomials
- Binary exponentation
- GCD and LCM
- Binary search
- Selection sort
- Mo's algorithm
- Sqrt decomposition
- Radix sort (LSD and MSD)
- Prime generator in O(n)
- Fibonacci heap
- Graham Scan
- Chan's algorithm
- Manacher's algorithm
- Hook length
-
When write generic code there are 2 approaches:
- OOP: Constraint a type with a method
- Procedural: Pass the method directly as a parameter
If the expected passed type is:
- user defined: Use procedural
- internal (defined in this module): Use OOP The reason is that an OOP approach is more elegant but less generic (hard to adapt when using multiple libraries with the same type), and procedural method is less elegant, but more generic.
- Every pointer receiver method assume that the pointer is not nil
- All assumption (if any) are specified in each function
- Numbers ovewflow errors are not covered
This library is for general purpose, but I want to maintain it compatible with https://github.com/lorenzotinfena/competitive-go so all the code should respect the limitations explained in the library. Maybe in the future the limitations could become less strict.