[Tutor] Python and algorithms

C.T. Matsumoto c.t.matsumoto at gmail.com
Thu Feb 18 16:16:00 CET 2010


Kent Johnson wrote:
> On Thu, Feb 18, 2010 at 9:43 AM, C.T. Matsumoto <c.t.matsumoto at gmail.com> wrote:
>
>   
>> Here is the example.
>>
>> "To keep this simple and practical, as a suggestion, consider the problem of
>> sorting a list (a pack of cards, or a list of names or whatever you want)
>> into order."
>>
>> Yes, there are many built-ins that wrap good algorithms, so I guess I'm
>> leaning more toward problem solving. The above example must be solved
>> without using sorted() or list.sort().
>>     
>
> To solve this without using the built-in sort then you will be
> learning about sorting which is a major portion of the study of
> algorithms.
>
> So, if you want to learn about sorting algorithms, this is a good
> problem to ponder. If you want to learn to be a better Python
> programmer, I'm not sure it is helpful - the built-in sort is
> excellent and you should be learning how to use it effectively, for
> example, given a list of (first name, last name) print the list sorted
> by first name, then sorted by last name.
>
> Kent
>
>   
Cheers Kent. I'll take your example too. As for the other example
I'm already quite stuck.

T


More information about the Tutor mailing list