This week's giveaway is in the Java/Jakarta EE forum.
We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line!
...and specifically...

O(log N) and O(N log N) ... generally mean that the algorithm deals with a data set that is iteratively partitioned, like a balanced binary tree... Generally, but not always, log N implies log2N, which means, roughly, the number of times you can partition a set in half, then partition the halves, and so on, while still having non-empty sets.

Posts: 4568
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In this case, it means inserting items into a PriorityQueue that contains n items (where n is large - these scalings are only really relevant for big numbers) scales with log(n). Let's say that you've got a queue with 10,000 entries, and it's taking four seconds to insert items (in the worst case). Then you'd expect a queue with 100,000 entries to take five second to insert items [because log(10000) = 4 and log(100000) = 5].
Lasagna is spaghetti flvored cake. Just like this tiny ad:
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!