Question 41
Question 42
Algorithms Design Paradigms (P) Dijkastra’s Algorithm (i) Divide and Conquer (Q) Strassen’s Matrix Multiplication (ii) Greedy (R) Fibonacci numbers (iii) Dynamic ProgrammingMatch the algorithm to design paradigms they are based on:
Question 43
int exp(int X, int Y)
{
int res = 1, a = X, b = Y;
while ( b != 0 )
{
if ( b%2 == 0)
{
a = a*a;
b = b/2;
}
else
{
res = res*a;
b = b-1;
}
}
return res;
}
Question 44
begin q := 0 r := x while r >= y do begin r := r – y q := q + 1 end endThe post condition that needs to be satisfied after the program terminates is
Question 45
Question 46
Question 47
Question 48
The minimum number of comparisons required to determine if an integer appears more than n/2 times in a sorted array of n integers is
Question 49
In a complete k-ary tree, every internal node has exactly k children. The number of leaves in such a tree with n internal nodes is:
There are 49 questions to complete.