2016年3月31日星期四

Week 11 Slog

It has been eight weeks since my first slog.  I improved a lot during this period of time.  I learned how to implement a parent and its children class.  I learned about stack, queue which turns out to be extremely useful when I implement puzzle.tool in assignment two.  I also learned about recursive structures such as trees, binary trees and binary search trees, they are really interesting and I learned a lot during this CSC148 class.

2016年3月24日星期四

Week 10 Slog

This week we move on to binary search tree and sort algorithms.  We studied bubble sort, selection sort and insertion sort in CSC108.  They are all in big O of n square which are not very effective solving large problems.  The lecturer introduced quick sort and merge sort to us, and demonstrated it with a example in the class which is really nice and explicit.

2016年3月18日星期五

WEEK 9 SLOG

This week we have out term test 2,  I have some trouble tracing recursion and coming up with an answer.  I read over all the lecture slides,  and all the methods and functions in tree, binary tree and linkedlist.  The third question in the test is super hard, I left it blank in order to get 20 percent of the mark.

2016年3月13日星期日

WEEK 8 SLOG

    This week we learned how to implement binary tree and the difference between a normal tree and a binary tree.  A binary tree contains can only have max two children for each root.  It has methods contain, str, eq and repr, as well as functions evaluate, postorder_visit, inorder_visit, visit_level, levelorder_visit, bst_contains and insert. One thing that bothers me a lot is that I can not understand the difference between those three visit algorithms, it seems to me that they are all the same.

2016年3月3日星期四

WEEK 7 SLOG

This week we focus on the topic of recursive structure.  The most typical example of recursive structure is tree.  The tree contains set of nodes with edges between some of the nodes.  The leading node is called root, the nodes connect to it are called children.  The node with no children is called leaf.  The tree also have height and depth.  The whole class of tree is a recursive structure.  The most of part the implementation of tree requires recursion.  I think recursion is really helpful although it is kind hard to understand first, however, once you master it you will find out it is really a really useful technique.