Q on "average"

Jan 17, 2012 22 Replies

=20

=20

and=20

vs=20

O(Nlog(log(N)))=20

=20

more=20

in=20

well.

with=20

No. It is not. Quicksort is the flag enhanced bubble sort. Faster than O(n^2) but not as fast as any of several O(n * log(n)) sorts. There is about 4 of them. Merge sort and shaker sort are two of them

Got an A+ on that project in school, all of the canonical sorts are in CAlgo published by ACM. There are about 7 of them. That is how many i used in the assignment.

?-)

You're perhaps confusing Shell's method with quicksort. Shell's method is O(n**4/3) or something like that, and is often the fastest algorithm on moderate-sized arrays. Quicksort and heapsort are the two classical n*log(n) methods--on average. Vanilla quicksort is actually an n**2 method if you try sorting an already-sorted list!

Cheers

Phil Hobbs

Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 845-480-2058 hobbs at electrooptical dot net http://electrooptical.net

than

is

i

I just saw my Calgo book yesterday, i can look all of them up again. Be much faster than trying to find my school program again.

?-)

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required