Performance in TreeMap access
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Sunday, October 10, 2004 11:54 PM

Hello,

Do you know which way to access TreeMap is quicker?
(children here is a TreeMap).

option 1)

for (Iterator iter = children.entrySet().iterator(); iter.hasNext();) {
Node n = (Node) ((Map.Entry) iter.next()).getValue();
}

option 2)

for(Iterator iter = children.values().iterator();iter.hasNext();)
{
Node n = (Node) iter.next();
}

Thanks in advance!

Amit

Re: Performance in TreeMap access

Posted By:   Michael_Decker  
Posted On:   Tuesday, October 12, 2004 12:40 AM

Please format your text with html-tags...
About | Sitemap | Contact