View Single Post
  #3 (permalink)  
Old September 6th, 2007, 11:39 AM
ciderpunx ciderpunx is offline
Friend of Wrox
Points: 1,515, Level: 15
Points: 1,515, Level: 15 Points: 1,515, Level: 15 Points: 1,515, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: Oxford, , United Kingdom.
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

You can use a LinkedList to implement a stack or queue, because each element is linked both to its predecessor and to its successor.

see:

http://java.sun.com/j2se/1.4.2/docs/...ArrayList.html
http://java.sun.com/j2se/1.4.2/docs/...inkedList.html

--
Charlie Harvey's website - linux, perl, java, anarchism and punk rock: http://charlieharvey.org.uk
Reply With Quote