Results 1 to 6 of 6
Thread: Java Performance?
 06092011, 07:43 AM #1Member
 Join Date
 Jun 2011
 Posts
 6
 Rep Power
 0
 06092011, 07:51 AM #2Moderator
 Join Date
 Feb 2009
 Location
 New Zealand
 Posts
 4,716
 Rep Power
 18
 06092011, 08:24 AM #3Member
 Join Date
 Jun 2011
 Posts
 6
 Rep Power
 0
For "Orders of common functions" table on that page, how would I know which notations compare against the other in terms of speed. I have heard them before used in Sorts when talking about the speeds but don't understand it really.
 06092011, 08:36 AM #4Moderator
 Join Date
 Feb 2009
 Location
 New Zealand
 Posts
 4,716
 Rep Power
 18
The table goes from fast to slow. (like it says!) But notice how it says "the slower growing functions are generally listed first". That's because the O() notation is defined in terms of asymptotic behaviour; we may have f(x)=O(1) and y(x)=O(n!) but still find for some specific value of n that f(n)>y(n).
 06092011, 08:52 AM #5
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 14,422
 Blog Entries
 7
 Rep Power
 28
Note that the bigOh notation doesn't mention anything about speed; it is defined in terms of elementary steps, e.g. one comparison is one step, one swap operation is one step etc. Consider an efficient algorithm (in terms of those steps); it runs much faster on a fast computer than on a slow computer; both computers perform the same number of steps. BigOh defines the number of steps given the size of a problem, e.g. the heapsort algorithm takes O(n*log(n)) steps to sort n items (which is a lot better than bubble sort which takes O(n*n) steps).
kind regards,
JosBuild a wall around Donald Trump; I'll pay for it.
 06092011, 12:43 PM #6Member
 Join Date
 Jun 2011
 Posts
 1
 Rep Power
 0
Analysis of Algorithms
Donald Knuth  Wikipedia, the free encyclopedia
Knuth: Selected Papers on Analysis of Algorithms
Similar Threads

Java Programs to Test Performance
By testarosa in forum Advanced JavaReplies: 4Last Post: 02272009, 01:04 PM 
How can we Use SoftReference in Java for better performance
By priyanka.dandekar in forum Advanced JavaReplies: 1Last Post: 10052008, 10:39 PM 
Java Performance Ideas
By developer321 in forum Advanced JavaReplies: 4Last Post: 06282008, 04:16 PM 
how to improve java performance
By sunjavaboy in forum Advanced JavaReplies: 6Last Post: 06152008, 05:58 AM
Bookmarks