How do I get the nth item in a queue in java? -


i have number of queues , priority queues in application. access nth items in these queues, don't see easy way using api. guess create iterator , iterate nth or use toarray()[index]--but seems there should easier way.

am missing something?

am missing something?

yes - fact accessing elements index not part of concept of queue.

if need access elements index, want list, not qeue.


Comments

Popular posts from this blog

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -

How to read input from STDIN in x86_64 assembly? -