2016年4月10日星期日
WEEK 12
This is the last week, and I am reviewing everything for the test, I am a little bit confused about the materials after term test two, but the good news is that I am still have a lot have time to review it. Also , the result of the assignment is not good, it says it crashed during the test, I tried to find why, where the reason is, but I could not find it.Anyway, I hope the TA can give me the comment to improve my code, my skill.
2016年3月30日星期三
Week 11
I revisited, week 7 slog, I found that I have changed some of my views and developed in some way. I still think that Recursion is important, useful, and can help us to solve a problem easily. But now, I do not feel difficult, because I put a lot of effort on it, I did every question on the lab and lecture PPT, then I realized nothing is hard unless you do nothing. Also, I found any recursive algorithm can be converted non recursive form. But, for me, I think recursion is easier. Now, I found that recursion can be used on trees and it is very important. We can use recursion to find a thing that we want in a tree, either normal tree or binary tree or even a binary search tree. We can delete it or change it or move it. In the future, we can use it to save information for us, and get information is a tree for us. Anyways, Recursion is everywhere in computer science, it is much more important than I thought in week 7. And I have an advice to my classmates if you want to do well in computer science, you have to master recursion, you have to do a lot of practice.
WEEK10
we learned efficiency of algorithms this week,this section is very hard for me ,because it is not teaching you how to implement, it is teaching you how to find run time of a function or program. I learned two types of run time . first one is n and second one is nlogn ,as the n becoming larger, the second one nlogn will be much more smaller than the first one. When we implement a function, we should try to use nlogn algorithms, it will make the function faster and less memory require
2016年3月23日星期三
SLOG WEEK9
This week, we learned binary tree and binary search tree, two trees are very similar, also very "different". They all have two children maximum, but in binary search tree, the value of left child must smaller than parent,and value of right child must bigger than parent. In binary tree,we do not care this. Also ,I was confused about preorder, inorder, and postorder, then I found some pattern, it help me to remember these three order.Also, in binary tree, we still use a lot of recursion. I also understand that binary search tree can be used to save informations, anyway, we have not learn this yet.
SLOG WEEK8
Tree, is a abstract data type, a tree has the head(root), and children, and parent, and height,etc. tree is different from binary tree. a parent can have many many children, but binary tree can only have two children. when we implement a tree method, we will use recursion usually. We implemented few method in the lad and class, such as count_height,count_leaf,etc. But I always confused about those terminologies, and I will try to understand those terminologies deeply, because it is very important in computer science.
2016年3月2日星期三
SLOG WEEK7
Recently, we have learned something called
recursion. Recursion is very important in computer programming, and it is very
useful. Sometimes, it can solve the problem easier than not using recursion. I
have never seen this word before, thus I feel a little bit difficult. In
computer science, recursion is a method that divides a big problem into several
small problems. The lecturer said that recursion must call itself in the
function text, otherwise, it is not recursion. Therefore, when I am dealing
with recursion, I have to think how do I call it in itself, and make it like a
“loop”, maybe it is not an accurate word to describe recursion, but I cannot
find another word to replace it.
"The power of recursion evidently lies in the
possibility of defining an infinite set of objects by a finite statement. In
the same manner, an infinite number of computations can be described by a
finite recursive program, even if this program contains no explicit
repetitions."(Wirth, Niklaus (1976). Algorithms
+ Data Structures = Programs. Prentice-Hall. p. 126.)
This is a very
accurate description by Wirth,
Niklaus. For example, Fibonacci
sequence. The following codes are doing Fibonacci sequence with and without
recursion.
def F(n):
if n == 0: return 0
elif n == 1: return 1
else: return F(n-1)+F(n-2)
def F(n):
a=1
b=1
temp=int()
for i in range(1,int(n)-1):
temp = a+b
a=b
b=temp
return b
From the codes, we can see that recursion can be simpler than
not using recursion. In the first version, we just like peeling a fruit.
Finally, we will get the core. Another method is more complicated. When we do a
more complicated question, we might make mistakes without using recursion and
the mistake is very hard to find in many codes. When I was doing the exercise,
I found that there is a mistake that people always make, the function call
itself infinite times and python give “maximum recursion depth exceeded” error to you. We need to
be careful.
2016年2月28日星期日
SLOG WEEK6
This week, most of my time are focusing on the assignment. The assignment is not really hard,but it is not easy too. You have to spend a lot time on it in order to get a good result. In the assignment, I learned what the PEP8 is, and I understand that format is really important, because other people need to read your code, if you have a bad format, then they can not understand your code easily. Debug is also really important, it can help to understand the project deeply, sometimes you spend more time on debug than coding.
2016年2月16日星期二
SLOG WEEK5
We had a test this week. After test, the instructor taught us "LinkedList", the concept of it is not hard to understand,but we you do it , it is not easy to do. In lab4, we were asked to implement some methods for the LinkedList, I learned about from it , I learned how to make a "LinkedList", and I understood this is very important in computer science, because for the "list", if you insert something in the head of the list, it will let computer move every item in list, it will increase the process time, but "LinkedList" solve the problem. However, this is really important, I have to master it .
2016年2月5日星期五
CSC148 SLOGS WEEK4
In this week, I learned Stack and Sack and Queue. I was confused by the concept of Stack, then I asked my TA, and he explained to me, also my friend explained to me and showed me the example. Next week is the midterm test, and I reviewed slides that we talked about in the class. I still have some questions, and I am still thinking about those questions, such as what is property(), what is _set_, _get_, I am confused, I did some search,but I am still confused, I hope I can figure it out soon before the test. I guess I will go to Computer Science Help Center. Anyway, I will work harder to improve myself.
2016年1月27日星期三
CSC148 SLOG1
Before I went to class, I thought the
course would be very hard for me, because I am not really good at CSC108. But I
found out that instructor is really nice, and his explanations are really easy
to understand. I was confused by those terms. But now I am ok with that. Also,
TA is really nice. During the lab, he helped us a lot, he can explain things
really clear. My goal in this course is to master everything in this
course, to do well, to get good grade in order to get into Computer Science
Major. This week, I learned a lot about special method and class. Because the
class just started, the new knowledge is not really hard to understand, thus,
there is not something that challenged or frustrated me. I feel really
confident about material covered this week class, I think I have to be really
confident, otherwise, I will study really hard to understand it. Last, I would
say I am glad I have a chance to take this course.
订阅:
博文 (Atom)