Firstly, I learnt some types
of sorting algorithm this week through Internet, such as merge sort & quick
sort & bubble sort & heap sort etc. Then I got an acknowledge of unit
tests, PyUnit specificlly. I think it's very useful as you can prepare for a
set of cases, then use them over and over to see where's the bug in your codes.
I think I will save a lot of time for using unit tests later, and it will also
let me grouping my test cases for different use such as boundary cases/ invalid
inputs / huge data & long computing time cases etc. Besides, I also learnt
that parentheses, brackets, braces matching is stored at stack
and done by compiler. From this lecture, the importance
of parentheses matching also been emphasized, and I'll keep in
mind checking every parentheses before run the codes.
2015年2月12日星期四
week5: Tracing recursion
This week, I learn about tracing recursion. It's basically about how to get a unknown problem solved by a known problem. For the sum_list problem, we solve a depth_n problem by looking at the n-1 terms, the we use n-2 terms to solve n-1 problem. Just like simplification the functions, we deduct step by step until we get the base case.
2015年2月4日星期三
Week4: Think like a computer scientist
The first thing to study computer science is to think like a computer scientist. It is a easy thing to learn about one computer language and to write codes. However, if we want to learn well the computer science, we must think program or think how to write the codes or how to solve the problems in computer scientist's way.
Just like the content we study in lecture, we need to build class and define method to solve the programs, which is the thinking method of computer scientist.
Just like the content we study in lecture, we need to build class and define method to solve the programs, which is the thinking method of computer scientist.
订阅:
博文 (Atom)