RECURSION REVISITED

Earlier this year I wrote about both my comfort and discomfort with recursion, that the method is simple enough, that there are only two steps to follow, yet recursion is such a difficult concept to conceptualize. I will have to agree with my past self, that recursion at first seems incredible hard to work with, then after you learn the tools of the trade (check for base case, get to base case) it seems incredibly easy, until you have to apply this knowledge for the first few times, where when you run into a problem, you have no idea where to start. This latter part happened for me in the last assignment.

Many of my classmates find recursion easy, yet they also had trouble in pruning, for part A in assignment 3. I was one of those people. On the surface recursion is easy, but put recursion together with another concept that you're iffy about, like minimax, and you're in for a tough time. This is mainly because following variables through so many instances gets tough to do, and very hard to conceptualize, so diagrams and drawing are the only things that can really help you. Of course after hours of tinkering around with variables I was able to solve this pruning problem, but to be honest I'm not even sure that I completely understand what's going on in my code. I have a general idea of what's going on as a whole and in first and second instances, but once it gets down to the nitty-gritty of comparing state scores and returning a final value, I'm kind of lost, to be honest.

No comments:

Post a Comment