In order to improve my tracing ability I plan on working through as many examples as I can. Looking at examples in the course notes will be very beneficial. Another way in which I could improve would be to create many examples of recursive code. I feel that I would understand the recursive process more if I was writing out the code line by line myself. The more exposed i am to recursion the more likely I will be to understand it, therefor in future assingments I will try to incorporate it in as many processes as I can
Sunday, 8 February 2015
Tracing recursion
Tracing recursion is fairly easy until abstract data types get involved. Working with basic examples of recursion seem very fun and easy, however when tracing recursion examples for items on a stack I found that the tracing became much more difficult. At first I was quite confused with the output I was recieving, I spent a great deal of time trying to trace over the function and figure out what was happening. Eventually I decided to cheat a little and add a few print statements within the code to check how the stack was being updated every time it was fed back into the recursive code. Although I eventually was able to understand the code I still feel like I need more practice before I can be confident in my tracing abilities.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment