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
Post a Comment