After reading week, our CSC148 course seems to be more difficult than before, especially the assignment two. However, our lectures continued the topics on recursion and mutation.
For week 7 and week 8, we learned two different classes called BTNode and LLNode, which can been seen as a tree and a linked list, respectively. Both classes can be closely associated with the recursion steps. We can take LLNode in week 8 as an example.
![]() |
LLNode consists value (the current node) and nxt (the node linked with current node) which can be treated as the child of value. The recursion steps happen since the nxt could also be the value of other nodes. The difference between we learned in week 7 and week 8 could be the way we imagine the diagram of these two classes. For BTNode, we should see the values as leaves in a tree, appending the values in left or right leaves in that tree and calculating the values by a distinct symbol. On the other hand, LLNode is a class that represents a linked list, each node has its own child, and child can also be the parents of other children. However, the essence of these two classes should be same. They both include the thoughts of recursion and mutation.
![]() |
| BTNode |
![]() |
| LLNode |
Assignment two seems to be more difficult than the assignment 1, especially winner in tippy game state and minimax strategy. In winner, we must containing all four possible states of forming a tippy. What's more, minimax could be consider as the most difficult problem we countered. However, once we figure out the recursion steps, and body of the method can be written easily. In this step, a tree diagram and written score for every steps in the corresponding position on the diagram.




No comments:
Post a Comment