MCQ1 mark
Consider an unordered list of distinct integers.
What is the minimum number of element comparisons required to find an integer in the list that is NOT the largest in the list?
Single correct
GATE CSE previous year questions · Algorithms
Single correct
Algorithms Design Paradigms
(P) Kruskal (i) Divide and Conquer
(Q) Quicksort (ii) Greedy
(R) Floyd-Warshall (iii) Dynamic Programming
Match the algorithms to the design paradigms they are based on.Single correct
Answer key coming soon
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;
}
Which one of the following conditions is TRUE before every iteration of the loop?Single correct
Answer key coming soon