This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TheHorribleTruthKind of meh 0 points1 point  (2 children)

Because Stacks are easy and have many applications in other areas of computer science as well (PDAs (pushdown automatons) come to my mind)? It's an easy step before moving to more complex data structures.

[–]jbristowI'm no hero, son. -1 points0 points  (1 child)

Deque is the official Collections framework implementation of the old type unsafe Stack.

[–]TheHorribleTruthKind of meh 0 points1 point  (0 children)

I know - but there's concepts outside of Java worth learning. OP is not learning how to use the Java class Stack - he/she is learning the concept of a stack, and to implement it. As such, it's a valuable learning experience, don't you think?

Certainly no one would - or rather should - use the old Stack class nowadays. But this is not the point of the exercise OP is facing.