Pages

Friday, April 4, 2014

The End is Near

Well, it looks like the course is almost finished.

On a related note, there is quite a bit of time until the final exam, so hopefully by managing my time well I'll be well prepared for it. Our last lab was last week, it dealt with sorting. I find sorting is interesting because it deals with complexity and I find complexity to be quite interesting. In our last lecture, we learned about dynamic programming. We learned that dynamic programming is useful when recursion causes the same steps to be repeated often, as it did when we were creating the fib function. Memoization was also something we learned in lecture, which allows us to save the results of recursive calls and then look them up. The idea makes quite a bit of sense, especially when implementing the fib function. We also saw in lecture that recursion has limits, or specifically the amount of times we can recursively call a function has a limit. We learned that we can actually change this limit, which is actually called the maximum recursion depth. One question I have is why there is even a limit to begin with? Perhaps, the computer can't process that amount of calls and might just end up exploding? Even though it sounds a bit ridiculous, I don't think it's all that far-fetched. But it turns out the real reason is to avoid stack overflow. Which leads to the question of what exactly does stack overflow mean? Stack overflow occurs when a function/program is trying to access more memory beyond the call stack's bounds. Maybe not as hectic as the computer blowing up into smithereens, but stack overflow can result in the program crashing.

It looks like this is going to be my last post, but definitely adventures in comp sci never stop! I'm really looking forward to taking more comp sci courses and learning more about computers and programming and everything in between. I'm especially looking forward to learning C/C++. This was an exciting year for me, and especially grateful for having such an amazing prof! Thanks Dan!