Complete GATE CSE 2020 Paper 1 overview, original pages and practice · Timed previous-paper practice

Questions 58–60 of 65. Imported answers require review unless explicitly marked reviewed.

Paper practice 65 questionsPage 20 of 22

Question 48

Open question
CSNAT2 marksNeeds review
Consider the following C functions.
int tob(int b, int* arr) {
int i;
for(i=0; b>0; i++) {
if(b%2) arr[i]=1;
else arr[i]=0;
b = b/2;
}
return(i);
}

int pp(int a, int b) {
int arr[20];
int i, tot = 1, ex, len;
ex = a;
len = tob(b,arr);
for(i=0; i<len; i++) {
if(arr[i]==1)
tot = tot * ex;
ex = ex * ex;
}
return(tot);
}
The value returned by pp(3,4) is ______.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 49

Open question
CSNAT2 marksNeeds review
Consider a graph

where

,

, and weight of the edge

is

. The weight of minimum spanning tree of

is ______.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 50

Open question
CSNAT2 marksNeeds review
Consider the following set of processes, assumed to have arrived at time 0. Consider the CPU scheduling algorithms Shortest Job First (SJF) and Round Robin (RR). For RR, assume that the processes are scheduled in the order

.
Process




Burst time (in ms)
8
7
2
4
If the time quantum for RR is 4 ms, then the absolute value of the difference between the average turnaround times (in ms) of SJF and RR (round off to 2 decimal places) is ______.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer