Week 12: The Last Slog
As the final week of classes
finish, the time to study for finals has arrived! Luckily, the CSC148
final is not until the 23rd, but there are many others to
be done before (at least for me). This week in class, we went over
how dictionaries worked, and we also had a review session of
everything covered over the semester. The explanation on dictionaries
was interesting, as in CSC108, we were told the ordering was “random”
(but not quite) in that to us it seemed random, but the computer had
its own way of ordering the indexes. I had been curious at what the
instructor meant by this, and now I know. The indexes are ordered
through hashing. That is, the indexes (which are immutable) are given
a number and are ordered based on those numbers. In addition, there
was also the review on Wednesday, which helped me remember what was
covered this semester.
Outside of class, the main
thing was E4. Overall, E4 was not that bad, the code for the function
insert was very helpful in writing the two functions needed. This
task probably would have been more challenging had the given code not
been provided. I did make a careless (and probably common) mistake of
returning the node.item instead of the node itself for E4b, which
caused the auto test to fail, but this was easily fixed. It seems one
recurring problem for me with this class (and in other classes as
well) is making careless mistakes even though I understand what I am
doing. For example, it is very easy to make a simple typing mistake
(such as leaving out a character in a variable name), forget to list
include a parameter in a function call, or misread directions
(especially in a test when I am nervous). I am prone to such
mistakes, which can sometimes be a major problem. The best way to
improve this in my opinion is to just check over my work before I
submit it. I usually catch most of my errors, but something almost
always manages to slip between my fingers (or I run out of time).
These mistakes are especially fatal in programming, as one small
error can cause the entire program to fail. But with more thorough
checking (something I normally do), and maybe having someone else
check my work (something I don't normally do but could try), I can
hopefully eliminate all of these mistakes.
The second last slog I
picked to read is http://47tulips.wordpress.com/.
This person found sorting, and big O to be the most difficult unit of
the semester, and I feel the same way. To me, big O requires a
different way of thinking than does writing code, which may be why
some people are uncomfortable with it. This person also mentioned the
sorts we learned in CSC 108 were very inefficient compared to the
ones we learned this semester. I agree, as I said something similar
in my entry on sorting. The very last slog form another person I will
read is http://supercskid.blogspot.ca/.
I thought this person's descriptions of merge sort and quick sort
were fairly accurate. Like the previous slog, this person is also
still getting used to big O. However, it was mentioned that the lab
for sorting was the easiest. I actually agree with this statement, as
a large part of it was just copying, pasting, and making graphs.
Interpreting the graphs was not too bad, as we already knew the run
times from class, and the graphs confirmed what was said in class.
Well, that was the last
slog. Goodbye everyone! See you at the final :)