Solutions to other tests:
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  

Mathematics for the Digital Age
and
Programming in Python


>>> Second Edition

Test 11

1.
B
2.
D
3.
(a) T   (b) T   (c) F
4.
D
5.
A
6.
B
7.
C
8.
D
9.
C
10.
B
11.
A
12.
(b), (d)
13.
D
14.
C
15.
(a)
16.
A
17.
B
18.
(a) F   (b) T   (c) T
19.
(a) T   (b) F   (c) F
20.
(a), (b), (c)

21.
xn = (3n - 1) / 2
22.
def maxList(lst): if len(lst) == 1: return lst[0] else: return max(lst[0], maxList(lst[1:]))
23.
def sumDigits(n): if n == 0: return 0 else: return n % 10 + sumDigits(n // 10)
24.
def traverse(root): if root is not None: traverse(root[1]) print(root[0], end=' ') traverse(root[2])
25.
def insertionSort(lst, n=len(lst)): if n > 1: insertionSort(lst, n - 1) insertInOrder(lst, n - 1)
26.



Copyright © 2010 by Skylight Publishing