Typically for this I’ve done some wrapper type around a vector storage for the node data (a wish.com arena, if you will). Links are just some abstraction around indices.
It’s kind of annoying to write initially, but it was easier than learning unsafe stuff. To do it correctly & most efficiently though, one would likely need unsafe code.
Man, I love this guy’s videos. He’s got the most pleasantly chill voice (think Australian Bob Ross) and shows a great mastery of the things he makes. Highly recommended channel.