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

Dave Angel davea at davea.name
Sun Feb 9 22:00:56 EST 2014


 Wesley <nispray at gmail.com> Wrote in message:
> 
>> > here is input sequence like a1,a2,...,an,b1,b2,...,bn ,the ax and bx always exist in pair. So, now, how to change the sequence to a1,b1,...,an,bn, with time complexity as O(n) and space as O(1).
>> 
>> 
>> 
>> The two halves of the list are already sorted, yes? 
> 
> [Wesley] No, not sorted yet..
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

Then supply some example lists and show the result you want. So
 far, your description is thoroughly ambiguous.

-- 
DaveA




More information about the Python-list mailing list