• Post Reply Bookmark Topic Watch Topic
  • New Topic

Stack and Queue Implementation

 
kri shan
Ranch Hand
Posts: 1486
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How the Data Structure - Stack and Queue is implemented in Java ?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All the data structures like these are provided by the Collections framework.
 
Joe Ess
Bartender
Posts: 9373
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.util.Stack extends java.util.Vector, which is a self-sizing linear array.
java.util.LinkedList is a doubly-linked list that also declares stack and queue data structure methods (i.e. get, remove, insert).
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!