Bit late but oh well, last week was rather crazy.
Assignment 1 is slain, and a mild repose has been won through Reading Week. Let's catch up, shall we?
The assignment wound up going much more smoothly than predicted. In 108, we had assignments that would paralyze us for hours with no navigable solution in sight. Now, it's a bit more clearly - something I think is in part thanks to classes.
As far as assignments go, A1 was actually pretty intimidating: making a functioning game?! We did that with the word-search in 108, but most of that was already written: here, all we really got pre-built were a few controllers for storing the sequences of moves and the graphical interface that wasn't even necessary to submit, since we would make a console interface anyway.
But lo and behold, it came together. Perhaps the worst moment was, after deliberating on the fastest possible recursion formula for hours, we looked through the handout again and saw that the formula was given to us. Ouch.
Nonetheless, that final part was by far the most interesting, since it required a fair amount of brain-work to complete. We did ours in three parts:
1. Finding the best i-value to solve for four stools. A somewhat ugly "best_min" function was made to calculate the ideal i by just running the formula and taking the best result. With that information, which was reinstituted for varying stacks of cheeses, we could proceed to
2. A four-stool function. Looking at the given recursive function, it worked in three steps:
a. Move n - i cheeses to a middle stool and stack them up.
b. Move the i remaining cheeses to the destination stool using the remaining three stools (since the remaining i cheeses were the biggest ones).
c. Move the old n - i cheeses to the destination.
This required a small bit of brain work, but Dustin's formula that he showed in class for three stools helped us deliberate on how to complete the work.
3. The three stool function, as shown by Dustin in class, for the middle step (2b).
That was the assignment. The other subject examined was related to the week's lab, which took on some fun and funky trees. I must say, the language can be a little defamiliarizing at first, but the diagrams are a godsend in computer science. I find it so helpful to see how our information is relating to one another, and trees themselves are very much built on creating that sort of diagram-form. It would be fun to develop a graphical interface to display that kind of information neatly.
The one thing I still need to wrangle before the midterm shall have to be linked lists, which seem straightforward enough (I can reason the idea of a "head" and a "rest") but shall require more review before they become entirely clear. As well, looking over old midterms I find my mathematical brain is getting a bit dusty - complexity requires due review to deliberate how complex a code is (i.e. how many operations needed in worst-case scenarios, with all these simple O(log n) and such algorithms.
No comments:
Post a Comment