Question 31
Question 32
Question 33
Question 34
<stmt> → if id then <stmt> <stmt> → if id then <stmt> else <stmt> <stmt> → id := idis ambiguous because a) the sentence if a then if b then c:= d has two parse trees b) the left most and right most derivations of the sentence if a then if b then c:= d give rise to different parse trees c) the sentence if a then if b then c:= d else c:= f has more than two parse trees d) the sentence if a then if b then c:= d else c:= f has two parse trees
Question 35
The minimum number of interchanges needed to convert the array 89, 19, 40, 17, 12, 10, 2, 5, 7, 11, 6, 9, 70 into a heap with the maximum element at the root is
Question 36
The recurrence relation
T(1) = 2 T(n) = 3T(n/4)+n
has the solution, T(n) equals to
Question 37
The average number of key comparisons done in a successful sequential search in a list of length n is
Question 38
50, 15, 62, 5, 20, 58, 91, 3, 8, 37, 60, 24The number of nodes in the left subtree and right subtree of the root respectively is
Question 39
Quicksort is run on two inputs shown below to sort in ascending order taking the first element as pivot,
(i) 1, 2, 3,......., n (ii) n, n-1, n-2,......, 2, 1
Let C1 and C2 be the number of comparisons made for the inputs (i) and (ii) respectively. Then,
Question 40
A. Activation record 1. Linking loader B. Location counter 2. Garbage collection C. Reference counts 3. Subroutine call D. Address relocation 4. Assembler
There are 75 questions to complete.