How would you implement a bi-directional linked list in Rust?
问题 Note that this question refers to a version of Rust before Rust 1.0. Although the syntax has changed, the concepts are still valid. You can easily implement a forwards only linked list using owned pointers, something like: struct Node<T> { next: Option<~Node<T>>, data: T } Imagine, though, if you want to efficiently implement a queue that supports four basic operations: push : add to end of list pop : remove and return from the end of the list unshift : add to the front of the list shift :