1. Member
Join Date
Jun 2011
Posts
6
Rep Power
0

## Java Performance?

I have been hearing phrases such as nlogn,O(n), etc and more for java. I'm not quite sure what this means but I know it has something to do with time/performance. Could someone explain or post a link where I can read about.

2. Moderator
Join Date
Feb 2009
Location
New Zealand
Posts
4,716
Rep Power
19

3. Member
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.

4. Moderator
Join Date
Feb 2009
Location
New Zealand
Posts
4,716
Rep Power
19
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).

5. Originally Posted by oaklandsbest
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.
Note that the big-Oh 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. Big-Oh 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,

Jos

6. Member
Join Date
Jun 2011
Posts
1
Rep Power
0

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•