Sunday, March 29, 2015

week 9 and 10 slog


Danny talked about binary search trees and sorting algorithms in terms of their time complexity in week 9 and 10. We missed our labs because of the strike, actually l was so annoying about it. We loosed the right to be tutored and learned knowledge.  We had test 2 on the week, it was not difficult . It just tested the material that Danny talked in class. And this week was the deadline to submit the assignment 2. The assignment 2 was very challenging, the most difficult part is to design the minmax_strategy class. I spent several days trying to come up with an idea for the minmax, which is a class that determines how the computer player play with the human player and which position is the best choice for the computer player to go, l really did not know how to implement it. But finally my partner finished the minmax class! Since l am not familiar with how to design a complete game program(I didn't  learn computer science in high school),  l think l should hire a tutor to teach me more about how to design a program in summer hoilday(like our assignment).

Saturday, March 7, 2015

Week 8 slog


The impression of this week
This week’s lectures focus on linked lists. And I find that I don't fully grasp the materials about linked lists presented in lectures.  Unfortunately, due to the CUPE 3902 strike, we no longer have tutorials to seek assistance. Based on CSC148's Information Sheet, I expect the term test 2 will occur next week, so we probably will be tested on linked lists. 


    def append(lnk, value):
        ''' (LinkedList, object) -> NoneType

        Insert a new node with value at back of lnk.

        >>> lnk = LinkedList()
        >>> lnk.append(5)
        >>> lnk.size
        1
        >>> print(lnk.front)
        5 ->|
             '''
        new_node = LLNode(value)
        if lnk.back:
            lnk.back.nxt = new_node
            lnk.back = new_node
        else:
            lnk.back = lnk.front = new_node
        lnk.size += 1

As shown above the method in link list,  my doubt is that after assigning new_node
to lnk.back.nxt, why not set lnk. back = lnk.front? After checking lnk.front and lnk. back , I find they are same at this step.


My plan 
  My plan is to review some lecture notes before the exam and to re-do the labs. My destination is to catch up on the whole materials we learned these weeks.  I will complete the lab exercise 7 later today. l will go to the office hour to figure out my problems relating to link lists.