[Tutor] stable algorithm

Alan Gauld alan.gauld at btinternet.com
Sun Dec 14 15:57:34 CET 2008


"David Hlácik" <david at hlacik.eu> wrote

> this is for me life important problem which needs to be solved 
> within
> next 12 hours..

Does that mean its homework?

If so we can only offer pointers, but you need to tell us what
you have done yourself first.

If its not homework then please give a bit more background.
What exactly are you doing that needs this sort? - can you avoid
sorting in the first place, for example? What are the volumes?
Why is it time critical?

> I have to create stable algorithm for sorting n numbers from 
> interval
> [1,n^2] with time complexity O(n) .

Where have you looked for algorithms?
Which ones have you considered? Why were they unsuitable?

Or when you say "create" do you literally mean you have to
invent a brand new algorithm? That seems a bit of a harsh
demand in just 12 hours?

> Can someone please give me a hint. Would be very very thankful!

Google/Wikipedia would be good places to start.
Then try the Python documentation on sorting.

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 




More information about the Tutor mailing list