410 likes | 435 Views
Figure 2.1 A recursive solution. Figure 2.2 fact(3). Figure 2.3 A box. Figure 2.4 The beginning of the box trace. Figure 2.5a Box trace of fact(3). Figure 2.5b Box trace of fact(3). Figure 2.5c Box trace of fact(3). Figure 2.6 A recursive solution. Figure 2.7a
E N D
Figure 2.1 A recursive solution
Figure 2.2 fact(3)
Figure 2.3 A box
Figure 2.4 The beginning of the box trace
Figure 2.5a Box trace of fact(3)
Figure 2.5b Box trace of fact(3)
Figure 2.5c Box trace of fact(3)
Figure 2.6 A recursive solution
Figure 2.7a Box trace of writeBackward(“cat”, 3)
Figure 2.7b Box trace of writeBackward(“cat”, 3)
Figure 2.7c Box trace of writeBackward(“cat”, 3)
Figure 2.8a Box trace of writeBackward(“cat”, 3) in pseudocode
Figure 2.8b Box trace of writeBackward(“cat”, 3) in pseudocode
Figure 2.8c Box trace of writeBackward(“cat”, 3) in pseudocode
Figure 2.8d Box trace of writeBackward(“cat”, 3) in pseudocode
Figure 2.8e Box trace of writeBackward(“cat”, 3) in pseudocode
Figure 2.8f Box trace of writeBackward(“cat”, 3) in pseudocode
Figure 2.9a Box trace of writeBackward2(“cat”, 3) in pseudocode
Figure 2.9b Box trace of writeBackward2(“cat”, 3) in pseudocode
Figure 2.9c Box trace of writeBackward2(“cat”, 3) in pseudocode
Figure 2.9d Box trace of writeBackward2(“cat”, 3) in pseudocode
Figure 2.9e Box trace of writeBackward2(“cat”, 3) in pseudocode
Figure 2.10 Recursive solution to the rabbit problem
Figure 2.11 Recursive calls that rabbit(7) generates
Figure 2.12 The recursive calls that c(4, 2) generates
Figure 2.13 Recursive solution to the largest-item problem
Figure 2.14 The recursive calls that maxArray(<1, 6, 8, 3>) generates
Figure 2.15 Box traces of binarySearch with anArray = <1,5,9,12,15,21,29,31>: a) a successful search for 9; b) an unsuccessful search for 6
Figure 2.16 Box trace with reference to an array
Figure 2.17 A sample array
Figure 2.18 A partition about a pivot
Figure 2.19a and b a) The initial state; b) move n - 1 disks from A to C
Figure 2.19c and d c) move one disk from A to B; d) move n - 1 disks from C to B
Figure 2.20 The order of recursive calls that results from solveTowers(3, A, B, C)
Figure 2.21a Box trace of solveTowers(3, ‘A’, ‘B’, ‘C’)
Figure 2.21b Box trace of solveTowers(3, ‘A’, ‘B’, ‘C’)
Figure 2.21c Box trace of solveTowers(3, ‘A’, ‘B’, ‘C’)
Figure 2.21d Box trace of solveTowers(3, ‘A’, ‘B’, ‘C’)
Figure 2.21e Box trace of solveTowers(3, ‘A’, ‘B’, ‘C’)