Tuesday, 24 March 2015

7: Week 8, A2 & Linked Lists

As week 8 came to end, we had to hand in the second assignment and we also learned about linked lists. We handed in our second assignment after a lot of hard team work on it. Our team, composed of three people, were able to grasp the concept of the minimax strategy though our implementation could use a bit more work. We didn't quite understand the need of having rough_outcome but it seems that will come in useful in the third assignment; I hope to do well in that one as well.

We learned about linked lists in class today, which is an extremely simple concept, frankly. If the information stored were to be people, it would be as if each person were to memorize who's in front of them (or alternatively, who's behind them). It's a rather simple concept but manipulating a linked list, such as changing an object or the order, or even searching for an object, is quite the opposite. When trying to change the list, you need to keep track of a lot information, such as who is in front, who is in the back and what position you are in, to name a few. Frankly, despite its complexity, I still believe I am able to comfortably handle and manipulate linked lists without many complications. Oh and the strike is still on.

Thanks!

Tuesday, 17 March 2015

6: Week 7, Nodes and Trees

So as week 7 came to an end, our lectures have only just grasped the basic concepts of binary trees.

The root of the tree is an object (a number, a string, anything) and is called a node. That node has the option of having children, in which the children are also nodes. If a node does not have children, the node is considered to be a leaf. Nodes that are not the root, the very first node in a tree, and have children  are named internal nodes. This week, we were introduced to the concepts of binary trees. In binary trees, all inetrnal nodes have exactly two children and all nodes are not empty. We also learned about binary search trees, in which all nodes represent a number. The child to the left of the node (conveniently named the left subtree) is smaller than the node and, similarly, the child on the right of the node is larger than the node. For example, if we have the values 2, 4, and 6; if 4 is the node, then 2 would be the child to the left and 6 would be the child to the right. If 6 was the node instead, the 4 would be to the left of the 6 and the 2 would be to the left of the 4. Here is a small example of a Binary Search Tree:
This allows the programmer to easily search through nodes as it allows them to cut their search times exponentially as it is not necessary to go through all the values.
The concept is easy and simple to grasp and it seems, from the SLOGs I've read, no one else had any problems understanding it.

Oh and the strike is still on.

Sunday, 8 March 2015

5. Recursive Recursion

It seems as though recursion is going to be a recursive theme in my SLOGs.

*sigh*

Seeing as we just completed the second assignment, I realize that recursion is not as simple as I thought it was. Despite our team's struggles we were still able to get together and work through a solution. Our minimax strategy code worked great for subtract square but it struggled when it came to playing tippy. We believe our code for recursion was well written and it could not have been possible had it not been for the strategy we used in our many lectures and labs. One of which is to have two cases; one which is simple enough to not require recursion and one which needs recursion to properly solve it. For the first simple case, we simply write an if statement which would apply for it but not for the more complex case. As for the recursive case, we write an else statement which takes advantage of recursion and uses the incomplete function to complete it (if you know what I mean).

On the other hand, fellow SLOGer Antiaromatic pointed out that recursion problems can be seen as "trees" and I completely agree with them. Though at times it might not be necessary to literally make a tree to use recursion, having a multiple-depth list in a tree-like manner can work just as well.

Oh and our TAs are on strike.