Implement the two versions of the solve Tower’s algorithm given in Segment 14.4. Represent the towers by either strings or single characters. Each method should display directions that indicate the moves that must be made. Insert counters into each method to count the number of times it is called. These counters can be data fields of the class that contains these methods. Compare the number of recursive calls made by each method for various numbers of disks.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here