I know about the System.Collections.Stack. I’m looking for a class that supports PushFront() & PushBack().
I know about the System.Collections.Stack. I’m looking for a class that supports PushFront() &
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Why not just use/wrap
LinkedList<T>? It hasAddFirstandAddLastmethods. You can wrap it to hide theAddBeforeetc. methods.The common term for this is deque (it means double ended queue). If for some reason wrapping a
LinkedList<T>doesn’t suffice (it should!), you could look at Eric Lippert’s implementation of an immutable deque.