mit 计算机科学及编程导论(12)

来源:互联网 发布:final cut pro x mac 编辑:程序博客网 时间:2024/06/05 02:32

words:

introspective , swallow your pride , latency , saw , symptom , haste , ramification ,  dust , raisin , tidy , revert , directory , anal , sermon , polemic , formulate , optimize , dual ,  constraint , bin , van , align , backpack , blanket ,  inventory ,  polynomial , burglar ,  grape , the periodic table , pour , dessert , thereof , discrete , stuff , trial , incarcerate , augment , dramatic 

notes:

sth added to debug:

1. experienced programmer will have their own module to debug , they will list some bugs they usually made and guess them first.

2. keep record of what you've tried to be systematic 

3. get help , try to explain to someone else or take a break

4.haste makes waste : don't fix when the thought first comes into your mind but to think will it fix all the symptoms (bug-free program)

5. make sure you can revert , save the old version


optimization problem :  a function to maximize or minimize & a set of constraints

1. continuous knapsack problem : greedy algorithm --- always do the best choices

2. discrete problem : 0/1 knapsack problem .  greedy algorithm doesn't work anymore , since local optimal decisions do not always lead to global optimal decisions. But greedy algorithm is fast and easy to capture .  Brute force can get the right answer but it's order of growth is exponential. So how we can optimize the brute force .  We must first figure out themath formulation of the problem in order to compute. Then we usedecision tree to analyze , and program . And we ascertain we can usememorizationto optimize .

ps: 

the professor use optimization problem to show us how to formulate problem into math form and then use computer to compute . This is the main theme in this course.

原创粉丝点击