Saturday, April 4, 2015

Last Week

This term seems past so quickly that all the lectures are done, and we completed all the assignments and labs. The final exam would be the only task left for us to do. It is obvious that this term was really tough since the strike of CUPE 3902 Unit 1, the labs were cancelled for nearly a month, and tests and assignment were graded for a long time. All  these things affected us in different ways, however, we all got through these things.

In my opinion, we learned a great deal of recursion on python for CSC148 course this term, from the simplest tree to linked list. In the last several weeks, we also learned about efficiency(sort) and the big-O difinition.

 For recursion, we learned it through tree, binary tree, linked lists and so on. And most of three assignments were closely associated to this. I think the functions were simplified by this, and easier to be understood.

For the efficiency part, different sort methods (bubble, insertion and selection) as well as big-O definition has been taught.  

Other sort method:
Break a list up (partition) into the part smaller than some value
(pivot) and not smaller than that value, sort those parts, then
recombine the list:
def qs(L):
    ''' (list) -> list'''
    if len(L) < 2:
        # copy of L
        return L[:]
    else:
        return (qs([i for i in L if i < L[0]]) + [L[0]] +
                     qs([i for i in L[1:] if i >= L[0]]))


Big-O definition:
Suppose the number of \steps" (operations that don't depend
on n, the input size) can be expressed as t (n). We say that
t 2 O(g) if:
there are positive constants c and B so that for
every natural number n no smaller than B,
t (n) cg(n)



Overall, I learned a lot through this term's CSC148 course. All the tough assignments and labs gave me an opportunity to challenge myself.