Re: Big oh Notation
From: Silvio Bierman (sbierman_at_idfix.nl)
Date: 02/23/04
- Next message: Tux: "Eclipse for Linux: Missing charsets in String to FontSet conversion"
- Previous message: Moth: "Re: Big oh Notation"
- In reply to: Moth: "Re: Big oh Notation"
- Next in thread: Yoyoma_2: "Re: Big oh Notation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 23 Feb 2004 22:43:21 +0100
"Moth" <not@this.address> wrote in message
news:hSt_b.73223$Wa.26732@news-server.bigpond.net.au...
> 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.
>
> 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?
> >
> >
>
>
If only we had a sorting algorithm of O(log2N) :-) Unfortunately both N and
log2N are significant here (N is more then log2N anyway) so you get O(N
log2N).
And for QS that is average behaviour, worst case is O(N^2) also. For a
sorting algorithm with worst-case O(N log2N) you would need something like
HeapSort.
BTW: Big O notation is used for any algorithm category, not only for sorting
algorithms.
Silvio Bierman
- Next message: Tux: "Eclipse for Linux: Missing charsets in String to FontSet conversion"
- Previous message: Moth: "Re: Big oh Notation"
- In reply to: Moth: "Re: Big oh Notation"
- Next in thread: Yoyoma_2: "Re: Big oh Notation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|