Sunday, 16 March 2014

Week 9

Week 9

Another week completed means another slog to be written, so here it is. This week in class, more on binary search trees and running time analysis were covered. For binary search trees, we further looked into the methods that can be performed on them, the importance of ordering, and how ordering can be preserved. It was also mentioned that searching a BST was most efficient when the tree was balanced, so half of the values could be ignored upon every completion of a search round. This began the transition into run time analysis, where the next questioned posed was, given a well balanced BST, how would the run time be described. The answer, as it turns out, is logarithmic, (which is efficient). In addition, the big O notation was introduced, which is used to described run times. Apparently, big O was introduced in CSC165, but I am not taking that (I'm not a CS student), so this is new to me.

Outside the lecture, the main things I worked on were exercise 3 and assignment 2 part 2. I actually finished exercise 3 last week, but I had some careless mistakes that caused a failure in my auto test report. Also, I think there was a mistake in the auto test, where the test for sum to deepest had an invalid input. This was mentioned on piazza several times, but I think the person doing the auto test fixed that, as I did not get that error again. So, after fixing my errors, I worked on A2 part 2. Because I had midterms in other classes to study for, I did not start part 2 until Thursday. When I started working on it, I read that we only had to write four functions. Initially, I thought that if I write two functions a day, I could finish this by Friday (tomorrow). As it turns out however, even though there are only four functions, they were much more difficult than they seemed. Writing one function and getting it to work was very time consuming for me, so I realized that two functions per day was too much. I then decided to write one function per day. When working on the assignment, I found the piazza forum very helpful, as many of the questions I had were already answered there. I have now written three functions, and I plan to write the last one (the one that makes a tree from the regular expression), later today.

The first slog I chose to read comes from “The Angry Student” at http://angryprogram.blogspot.ca/. (What makes this student angry anyway?) I usually look at the most recent post, but this time, I decided to look at some of the earlier ones. In one entry, this person writes about Project Euler. I have not done any problems on this website, but I have heard about it. A few years ago, when I did not know anything about programming, one of my older siblings wanted me to do it in order to teach me programming. But, as I was lazy and not interested, that never worked out. Now, however, I do know a little and would like to see if I can solve these problems. Maybe one day, when I have more free time, I will try it. Anyway, moving on to the next slog: http://pythonisnotasnake.wordpress.com/ (I picked this based on the funny title). The first sentence in this was “Wow I need to post more often on this blog!”. When I read this, I checked to see how many entries this person had, and there were only three, so I guess that statement was right after all. Aside from that, the most recent entry had to do with recursion. Three laws (obtained from a web site) were mentioned. I agree with these, but in my opinion, the first two about the base case are saying almost the same thing and could be combine into one. Having three laws also reminds me of Newton and physics.

No comments:

Post a Comment