Please grade my last post on OOP
http://silvercsc148.blogspot.ca/2015/03/object-oriented-programming-summary.html
We are dealing with recursions in the methods contained in the class of tree ADT these few weeks. To begin with, we were introduced to a bunch of Terminologies. For example, internal node is A node with one or more children and arity is the maximum number of children for any node in a tree. Then we implemented the tree ADT which led to the implementation of recursion. The general form of recursion is as follows:
if < condition to detect a base case > :
< do something without recursion >
else: < general case >
< do something that involves recursive calls >
After we got familiar to this abstract data type, for the week just passed, we practiced writing functions that involved recursive calls. The procedure in doing this was essential because they might seem scary at first, but after breaking them down into small steps as indicated above they became doable to me.
No comments:
Post a Comment