Saturday, 26 October 2013

If at first you don't succeed... come back later?

I've found that with the exercises, especially the last few weeks where they've involved a lot of recursion, it's easy to get stuck on a problem and spend too much time with few results. The longer you think about a problem, your brain starts to go in circles coming up with the same fruitless ideas again and again .... and the longer this goes on the more disheartened you become about ever solving the problem.

The best way I've found to battle this issue is to get up and walk away for a while, a few minutes, hours or maybe even overnight, and approach it with a fresh mind later. I've found the recursion problems are the ones that I usually get stuck on, as I'm still not used to the way of thinking about recursive problems (i.e. how a computer will solve it, how a base case will be dealt with, how each higher case will be dealt with). It seems at times it still takes me some quality brain work (both conscious and unconscious) before I can figure out how to program recursively.

On the other hand, happily, it took me almost no time at all to come up with an implementation for this week's exercise! I've gotten a good grasp on binary trees and this week's lab really helped with figuring out nodes and how to deal with binary trees in terms of nodes.

Cheers 'til next time

5 comments:

  1. Yeah honestly this week's lab was sort of just changing a few lines from the lab. Oh wait, wrong week. You're talking about last week. Anyways, couldn't agree more with the walking away from the problem.

    ReplyDelete
  2. I think it is always a great practice to take a short break (by walking, etc) when on stuck is solving a problem. I completely can understand the vicious cycle of thinking your are talking about. This happens to every one and your way of handling it is a good one.

    ReplyDelete
  3. Good thinking! I find it always helps to take a rest as well, it's never a good thing to stress your brain out too harshly. Especially with something like recursion. Glad to hear you're getting the hang of it.

    ReplyDelete
  4. Good advice. If you're not thinking about a recursive algorithm the right way it could take hours. This is unfortunate since the solution usually takes only a couple of minutes.

    ReplyDelete
  5. I feel the exact same way. Sometimes, I get so caught up with trying to solve a problem in one certain way that I waste so much time trying to work it out ... And then, after a break, some time to breathe, or even a few days, I come back to the problem with a new approach that works SO much better. -.-"

    ReplyDelete