Search algorithm (with a sort algorithm already implemented)
Posted
by msr
on Stack Overflow
See other posts from Stack Overflow
or by msr
Published on 2010-05-21T17:06:47Z
Indexed on
2010/05/21
17:10 UTC
Read the original article
Hit count: 976
Hello,
Im doing a Java application and Im facing some doubts in which concerns performance.
I have a PriorityQueue which guarantees me the element removed is the one with greater priority. That PriorityQueue has instances of class Event (which implements Comparable interface). Each Event is associated with a Entity.
The size of that priorityqueue could be huge and very frequently I will have to remove events associated to an entity.
Right now Im using an iterator to run all the priorityqueue. However Im finding it heavy and I wonder if there are better alternatives to search and remove events associated with an entity "xpto".
Any suggestions?
Thanks!
© Stack Overflow or respective owner