Q1 A)[3] False False True B) [9] 1 n n; 1 1 n; 1 1 n C) [2] depends on usage: circular array if the # of element is known in advance; linked-list if the size is not known Q2) A) [12] if (i >= ar.length -1 ) return true; return ar[i] <= ar[i+1] && isSortedHlpr(i+1, ar); B) [4] test cases: list of one element sorted list of two elements unsorted list of two elements sorted list of more than 3 elements unsorted list of more than 3 elements Q3 A) [3] O(log n) the loop is executed log_10(n) inside loop is O(1) B) [2] 109 C) [15] True ones 2 marks, false ones 3 marks (2 marks for value of n) True False, e.g. n=20 True False, e.g. n=1 True False, e.g. n=31 Q4 A) [3] In A: 1 In A: 20 In B: 2 B) [17] all one marks, except 5, 6, 8, 10 have 2 marks execpt 1 and 7, half of the mark of each part is the output. (every cross is .5 mark deduction) 1. N 2. Y [A1]:3 3. Y [A2]:33.0 4. Y [B2]:2 5. Y [B1]:3 6. Y [A2]:33.0 7. N 8. Y [B1]:4 9. Y [A2]:44.0 10 Y [A1]:1 11 Y [B1]:1 12 Y 1 13 Y 20