Truth be told, I was at the verge of a mental breakdown last week due to Assignment 2. Learning from the mistake of Assignment 1, my group and I decided to tackle the second assignment 10 days earlier, so that we can visit office hours more frequently. However, the office hours proved to be utterly useless as both professors responded to my group’s questions with ambiguity. To my frustration, whenever a question related to strategy minimax was asked, the professors would reply: “I will leave that for you to think about.” Well, I wouldn’t have attended office hours if I hadn’t already thought about the assignment throughly and get stuck for days. I know my complaint might sound obnoxious and whiny, however, it was difficult to restrain my anger after wasting my class time going to helpless office hours that I had to sacrifice class time for. Now, TippyGameState, TippyMove and GameView were quite easy to write since they are similar to that of a Subtract Square game, and after a few hours, my group and I were able to finish the code. On the opposite, strategy minimax seemed impossible to derive an algorithm. My group and I spent two whole days discussing ideas and solutions to strategy minimax, and whenever we began implementing our ideas, we get stuck writing the code halfway. After multiple fruitless attempts, and after abandoning many ideas, my group decided to attend office hours, which later turned out to be time wasting and useless.
Despite facing an unprecedented obstacle, such an unhappy event did not deter me from showing an interest in binary search tree. Due to my fascination and curiosity with such a brilliantly structured tree, I decided to do a quick research on its origin and inventor. From Wikipedia (I know it might not be the most credible and reliable source, but it is the quickest way to research about materials), I learned that the binary search tree (BST) was invented in the 1960 by Windley, Booth, Colin and Hubbard. Each node in a BST contains a maximum of two children, whereby the left node contains a number smaller than the number on the parent node, whereas the right node contains a number larger than the parent node. This structure is very important because it shortens the time of search by half. Relating to the BST is the methods of traversing the nodes. There were three ways of traversal taught in class. The first one was preorder traversal:
![]() |
| Order of traversal: F,B,A,D,C,E,G,I,H |
The second one was postorder traversal:
![]() |
| Order of traversal: A,C,E,D,B,H,I,G,F |
And the last was inorder traversal:
![]() |
| Order of traversal: A,B,C,D,E,F,G,H,I |
At first, the professor’s definition was a bit confusing to understand since it lacked a clear picture. However, after being shown pictorially how to traverse the binary tree in all three orders, my confusion was cleared.
In conclusion, my impression of last week was horrible due to my inability to write code for strategy minimax. In order to remember the parts where my group and I had problem with, I summarized three major questions regarding strategy minimax:
1. How to derive the scores of the next possible game states using recursions?
2. After computing all the scores, how to select the best score?
3. Lastly, upon determining the best score, how do I associate the score with its corresponding move?
Hopefully, my group is able to solve these problems before the assignment is due.



No comments:
Post a Comment