In this week’s
lecture, we started covering linked list data structures and some of its properties.
Linked list consists of group of nodes, which together represents a sequence
and each data element in the list contains a link to its successor. In class,
we implemented list and linked list classes that consist of numbers and kept track of its size, back, and front of the list. We also touched upon concepts
that mutate the linked list as we add or delete items from its data. One way I
would like to think about linked list is with this fun idea. Let’s make
a list of all the things we do in the morning. We can call the list my morning, and brainstorm all the activities
we do during this time. Some of possible activities are: wake up, brush teeth, shower, do homework, comb hair, eat breakfast, go
to class, motivate self, and get
dressed. However, these activities are not in the actual order I do them in
the morning. For example, I brush my teeth before I shower, I shower before I
do homework, and I comb my hair after I get out of the shower. Linked list will allow us to organize and put
them in a sequence in a much simpler fashion by putting in some “arrows”. Now
our list will have a structure like this:
This is the structure of our linked list. Each of the activity above is called a node, and we have 8 nodes. These nodes all have a data value and a reference to the next node. Here, our first node (front) is brush teeth and we can proceed by following the linkages to the next node shower, then to the next comb hair and so on. Finally we reach a node with a data value with no reference to another node which then tells us we have reached the end of the list; go to class is the last node (back) of this linked list called my morning.
This week was also a busy week as assignment 2 was due on Thursday. My partner and I struggled on starting on the assignment but eventually we developed a plan. We decided to find a way to produce the game board first, and implement the following methods that allow the user to input the size of the game board. Next, we thought of how we want the game to proceed as we take the player’s input of X and place it on the board. We then brainstormed how to check for the winning condition. Lastly, we completed minimax. This was a challenging assignment as we got our program to work with minimax right before the deadline. My partner is a better programmer than me as he had much more experiences in coding in various platforms, and he was able to lead me through the assignment and help me understand the concepts. Nevertheless, I am happy that it is working and done with.

No comments:
Post a Comment