I'm truly learning Rust these days by getting my hands dirty, writing code and fighting with the borrow checker, but before that I did exhaustive research on pros/cons, peculiarities, language issues, etc. One of those points was regarding recursive types like linked lists, and I was convinced that it is indeed a "niche" data structure — the problems I solve with linked lists in real life in my small personal projects can and are being more easily solved just using arrays and vec!. Here's where we get to the point of the title: since I'm using a 90/10 strategy — 90% of my time on Leetcode solving problems using Rust and 10% putting silly ideas into practice, like a todo list — I ended up finding a divergence between the "mainstream" Leetcode problems and this recursive type situation. A good portion of the problems categorized as "medium/hard" are basically: implement a linked list, insert an element in the middle of the list, etc., but using a "LinkedList" from the problem itself and not the std::collections::LinkedList type. I wanted to know your opinion: how much will solving this kind of problem actually help with learning Rust?
PS: I'm not saying I won't learn anything, but instead of having to research the most extreme edge case of all edge cases, it seems counterproductive.
PS2: An example of a super interesting problem I solved was "Longest Substring Without Repeating Characters" — in it I understood peculiarities of vec!, array, subtleties between usize and u8, sum overflow, loops, iterators; each attempt to do it right I learned more, and then to optimize the extreme cases I saw more details of the language itself instead of trying to implement something that is canonical in the language. On the other hand, I feel like I spent too much time on this other problem "2. Add Two Numbers" trying to recreate something that is already known to be problematic (LinkedList has a whole book dedicated to it, man!) and which are cases I really can't see an immediate use for in the language.
> PS3: I'm not a begginer on programming just begginer on Rust
I hate linked lists, thankfully not much need but you can do it fairly quick in rust
the point is not this, is how much spending my time of learn Rust using leetcode and so many problems involving linked list, that is a problem itseflt, is worth? I can just move and change this learn path and focus to focus on racking my brain to implement my silly ideas using Rust
Don’t use Rust for Leetcode. Not the right tool for the job.
Python much more popular, unless you need Rust for a specific role
I am with this feeling
When not using unsafe rust, linked lists are a pain to figure out at first. With unsafe they are pretty mich the same as in other languages.
rust cant express a linked list in safe and efficient way :)