grokking_algorithms
grokking_algorithms copied to clipboard
Update examples for Zig
trafficstars
This PR updates the code examples for the Zig programming language.
Those examples where introduced in #242 but, since the Zig language is evolving at fast pace, they needed some adjustments:
- Replaced
varwithconstfor non-mutated variables - Better implementation for Dijkstra's algorithm
- Removed
async/awaitsyntax as it is (temporarily) not provided any more by the language. Replaced by threads - Updated standard library names and signatures
- Other small improvements
The code has been tested using zig version 0.14.0-dev.577+3344ed8b8.