This week, we continued with recursion and trees and dealt with more difficult examples. I think I am starting to get the hang of recursion now. It is a really nice tool to use especially when the depth of the data structure one is using can vary. With regards to trees, they are easy to visualize and deal with recursively. The only thing I am working on right now is figuring out how to visit a tree level by level. I have a good idea on how to write code to access the node then its children and then its grandchildren but, I am trying to figure out how I can check all the children before checking the grand-children. Although the solution is posted, I am going to persevere to try to solve it myself before looking at the solution.
No comments:
Post a Comment