Rust - Simple graphs algorithms
Graphs (and trees - their special case) are data structures used in modeling complex problems such as finding an optimal route, exploring possible moves in a game, caching engines, modeling relations and more . That’s why they are very often the fundament of software engineer interview tasks in big companies - FAANG. Let’s implement some basic graph algorithms in Rust.
Rust - single ownership and self reference
Rust is a great programming language that achieves memory safety by forcing a single ownership model and borrow-checker mechanism.
That is actually problematic for data structures that require referencing Self type e.g. graphs, trees, and double-linked lists.
So it is impossible in Rust to express this:
By Tomasz Kuczma
read more
