A Rust CLI that implements a singly linked list from scratch in Rust using Box and Option.
Boxes(Box<T>) allow you to store data on the heap rather than the stack. What remains on the stack is the pointer to the heap data. It is a smart pointer.
A linked list is a linear data structure that stores data in nodes, where each node contains a data element and a reference (or link) to the next node in the sequence. This structure allows for efficient insertion and deletion of elements, especially compared to static arrays.
Practiced managing heap-allocated memory, manual traversal, insertion, deletion, and value search—without relying on built-in containers like Vec.
When to use Box:
Example:
fn main() {
let b = Box::new(5);
println!("b = {b}");
}