Building Core Data Structures in Rust II: B-Trees
When learning Rust for the first time, the recommended resource is the Rust book which gets you up to speed. However, depending on your prior programming experience (coming from a garbage collected language) or your CS background (you know your data structures), you might get overwhelmed by the amount of new concepts you need to familiarize yourself with.
This article hopes to better your understanding of 3 data structures: The Stack, The Heap and B-Trees — and maybe give you a reason to write Rust today. My goal is not to regurgitate implementations of each one but to show how useful they actually are in the real world. The final full-fledged implementations can be found here .
Each section will follow a similar format with 3 subsections:
- Theory: We go over the data structure we’re about to build (for readers with no data structures background).
- Implementation: We learn how to build the stuff.
- Deep Dive: We then have a deep dive into an important use case.
I also won’t be discussing time and space complexities so as to keep things straightforward.
Although I intend to make this post as accessible as I can, experience with Rust is expected. I recommend going through the Rust book first and coming back when comfortable.