This repository contains the Go source code for the algorithms in the textbook Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.
The official Java source code is here.
Make a Go implementation of the library so that a Go programmer can follow this book easily or prefer to demonstrate the algorithms using Go.
Try to keep the interface and variable name consistent with the original book while writing idiomatic go code.
Unlike Java or Python where you can put main
function in a file directly. In go
the main
function has to be in the main
package and in the cmd directory by convention.
To test each algorithm(data structure), instead of running the file directly, you have to run the file under cmd directory. Example: cmd/bag/main.go
- 1 FUNDAMENTALS
- 2 SORTING
- 3 SEARCHING
- 4 GRAPHS
- Graph
- Digraph
- MST
- Shortest Paths
- 5 STRING
This code is released under MIT.
Issue reports and code fixes are welcome. please follow the same style as the code in the repository and add test for your code.