Shortcut for chapter specific information

Wednesday, April 27, 2011

Daily Practice 20110427(b)

Insertion sort 48 - 51 (python) : only 51 is good.  48: I don't even know the syntax. 49: syntax error, there is no i-- in python.  50, I don't realize the python use 0-based array!
Selection sort 17-19 (python) : only 19 is good.  17: don't realize python has zero-based array. 18: can't remember the cause.

It's good to exercise in unfamiliar language.  Python's code is significantly shorter than perl and C even in simple programs such as insertion and selection sorts.

No comments:

Post a Comment