Sort one sequence by O(n) in time and O(1) in space

Roy Smith roy at panix.com
Sun Feb 9 19:15:38 EST 2014


In article <52f80bca$0$29972$c3e8da3$5496439d at news.astraweb.com>,
 Steven D'Aprano <steve+comp.lang.python at pearwood.info> wrote:

> On Sun, 09 Feb 2014 10:05:02 -0500, Roy Smith wrote:
> 
> > Is this a homework problem?
> 
> and then (paraphrasing):
> 
> > working code that solves the problem
> 
> /headdesk

I gave him the benefit of the doubt.

Also, as I look at my solution, I realize it doesn't really meet the 
O(1) space requirement.  Understanding why is left as an exercise for 
the reader :-)



More information about the Python-list mailing list