• Post Reply Bookmark Topic Watch Topic
  • New Topic

Collections API  RSS feed

 
Patricia Samuel
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
While going through the Collections API , I got puzzled with following line mentioned in the document.

The sorting algorithm is a modified mergesort (in which the merge is
omitted if the highest element in the low sublist is less than the
lowest element in the high sublist). This algorithm offers guaranteed
n log(n) performance.


Here, I am not able to understand the meaning of n log(n). How do we measure performance of an algorithm by using BIG 0 Notation. Kindly explain it or provide me some tutorial that can help me understanding this notation.
 
vanlalhmangaiha khiangte
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can read about this algorithm here

Worst-case performance is measured as:

10,9,8,7,6,5,4,3,2,1 has to be sorted as 1,2,3,4,5,6,7,8,9,10


Hope this helps
 
Campbell Ritchie
Marshal
Posts: 56534
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found this on Google; there were lots of other hits.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A A heavy weight explanation on Big O. I suggest googling for Big O to get other simpler explanations.
[ November 06, 2008: Message edited by: Martijn Verburg ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!