Link Details

Link 63508 thumbnail
User 237426 avatar

By Macbeth
via kai.system7.de
Published: Jan 28 2008 / 23:02

Nice performance article.
  • 9
  • 13
  • 3611
  • 1941

Comments

Add your comment
User 271248 avatar

TrekkyLeaper replied ago:

4 votes Vote down Vote up Reply

If you don't already know this, and I am interviewing you, give up now. I especially like the graph that shows the n^2 and n relationship through experimentation. You should be able to draw that graph based off the code without a second thought.

Oh, and a hash does not use a tree search. That would be logarithmic lookup time. It uses a hash, which is constant in the best (and usually average) case but as bad as linear in the worst case.

User 201914 avatar

nightwind replied ago:

-2 votes Vote down Vote up Reply

Don't be too harsh, obviously this is a fresh CS student exploring data structures. :)

User 254602 avatar

Nick Brown replied ago:

0 votes Vote down Vote up Reply

In his defense, I fear there are far too many software engineers out there who don't know this (or who may know it in an academic sense, but never think to apply it when developing). How often do you see Java programmers just use java.util.ArrayList for every single collection of objects, even when something like HashSet or HashMap would be better suited (and if they refer to it via an interface, its usually a java.util.List, not a java.util.Collection, so its not trivial to replace it)?

User 237426 avatar

Macbeth replied ago:

2 votes Vote down Vote up Reply

OK.. I wrote him an email and now he fixed the mistake with the tree structure.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.