Re: Big oh Notation
From: Yoyoma_2 (Yoyoma_2_at_[at-)
Date: 02/25/04
- Next message: Stewart Gordon: "[OT] Re: Big oh Notation"
- Previous message: sayoyo: "reuse a thread which is no longer "alive""
- In reply to: Moth: "Re: Big oh Notation"
- Next in thread: Oskar Sigvardsson: "Re: Big oh Notation"
- Reply: Oskar Sigvardsson: "Re: Big oh Notation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 25 Feb 2004 16:20:37 GMT
Moth wrote:
> Big O is pretty simple. The O stands for "the Order of" and it shows the
> general number of comparisons needed in a sort algorithm. For example, the
> average number of comparisons for a selection sort is =N^2/2-N/2. In this
> case the N^2 dominates and so the big O notation is O(N^2). For a quicksort
> I believe it is =N(log2N) which defined as O(log2 N) because the log2N,
> against a large number of items, will dictate the amount of time taken.
Oh just a little thing you missed i think. Big O notation is the "Worst
Case" notation. Meaning that the worst case is what is going to happen
after the O. For example, the worst case in picking a number of an
array with a simple for loop is O(n). Because n (the number of
elements) is the worst-case scenario (that the number you want is at the
end).
There are two other notations. Big-Omega (I don't have the omega
symbol, but its like the Ohms symbol if you remember that from
electronics) means the best case scenario. For example, if your
element is at the begining of the array.
Now there is another one that talks is 'tight-bound'. This is your
"average" case and is the best to compare two algorithms. Since an algo
could be excellent, but have one very bad case, O notation only shows
the worst case. But the Big-Theta notation shows the average case.
If you are a beginner you can compare with O notation to algorithms, but
if you have done this before or have some math background, i would
suggest comparing with Big-Theta.
For a good site, its usually mathematics sites that have it. Here our
class book. This is probably what you might be you are looking for.
Cormen, Leiserson, Rivest, and Stein: "Introduction to Algorithms",
McGraw Hill, MIT Press.
Or any good Discreet Math book will have it.
>
> Hope this helps a bit.
>
>
> "jova" <Email@nospam.net> wrote in message
> news:fL9_b.43099$M8.3955@nwrdny02.gnilink.net...
>
>>Does anyone know of a good site where I can learn of this?
>>
>>
>
>
>
- Next message: Stewart Gordon: "[OT] Re: Big oh Notation"
- Previous message: sayoyo: "reuse a thread which is no longer "alive""
- In reply to: Moth: "Re: Big oh Notation"
- Next in thread: Oskar Sigvardsson: "Re: Big oh Notation"
- Reply: Oskar Sigvardsson: "Re: Big oh Notation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|