Java - sorted stack

Posted by msr on Stack Overflow See other posts from Stack Overflow or by msr
Published on 2010-04-22T19:32:32Z Indexed on 2010/04/22 19:43 UTC
Read the original article Hit count: 497

Filed under:
|
|
|
|

Hello,

I need a sorted stack. I mean, the element removed from the stack must be the one with great priority. Stack dimension varies a lot (becomes bigger very fast). I need also to search elements in that stack.

Does Java give some good implementation for this? What class or algorithm do you suggest for this?

I'm using a PriorityQueue right now which I consider reasonable except for searching, so Im wondering if I can use something better.

Thanks in advance!

© Stack Overflow or respective owner

Related posts about sorted

Related posts about order