Monday, 10 March 2014

Week 5 - More Recursion


Well, week 5 has just ended, and we are almost half way through the course. As I discussed in my last post, recursion has not been going good for me. To be honest, I'm not liking it at all. I know, it is amazing to watch the results the recursive functions output, but it is equally (or even more) complicated to write these functions.

My experience from this week of classes is very similar to the last weeks. It was not that I lacked confidence, but it was just that I couldn't come up with any recursive solutions of my own unless and until Dan showed us the solutions. However, it was not all bad; I did enjoy understanding the implementations of some of the functions Dan showed us in lectures. One of them was the guessing_numbers functions, which I particularly found very interesting. (This may be because I could actually figure out what to do after Dan just finished writing the first two lines of the function!). Poor me. The binary_search function also was not too difficult to understand once I saw the code. However, I do still have trouble understanding the binary search function that returns the index of the given element. This seems way too complicated.

I know, the way I am progressing with recursion will not take me long. So far, this is the only topic which I found difficult. Sorry, extremely difficult. This might even be the reason for me missing out an A in this course. However, I am working hard, and started to look at some past years' question papers. So far, I did solve few of the questions from these papers, which involve recursion, but only after several attempts.

Oh, I almost forgot to mention but I did achieve something great at the end of this week! I actually figured out how to solve the final part of Assignment 1! Thanks to Dan, for his tips in the lecture and providing us with the Towers of Hanoi function. It helped incredibly! However, after some modification, this function only helps partly in solving the problem. So, after doing a fair bit of research on the Internet, I found an algorithm for writing the other recursive function required to solve the problem. Hope I will be able code it without too much difficulty!

Well, the weekend has just started, and I look forward to finish the assignment before the next week of classes.

Wishing myself and everyone a happy weekend!

No comments:

Post a Comment