MCQ1 mark
The result evaluating the postfix expression 10 5 + 60 6 / * 8 − is
Single correct
GATE CSE previous year questions · Programming & Data Structures
Single correct
#include<stdio.h>
int main( )
{
static int a[ ] = {10, 20, 30, 40, 50};
static int *p[ ] = {a, a+3, a+4, a+1, a+2};
int **ptr = p;
ptr++;
printf("%d%d", ptr-p, **ptr);
}
The output of the program is _____.Numerical answer
Code segment 1:
//initialize elements of Y to 0
//initialize elements X[i][j] of X to i+j
for(i = 0; i < n; i++)
Y[i] += X[0][i];
Code Segment 2:
//initialize elements of Y to 0
//initialize elements X[i][j] of X to i+j
for(i = 0; i < n; i++)
Y[i] += X[i][0];
Which of the following statements is/are correct?
S1: Final contents of array Y will be same in both code segments
S2: Elements of array X accessed inside the for loop shown in code segment 1 are contiguous in main memory
S3: Elements of array X accessed inside the for loop shown in code segment 2 are contiguous in main memorySingle correct
Single correct
C = 100;
for i = 1 to n do
for j = 1 to n do
{
Temp = A[i][j] + C;
A[i][j] = A[j][i];
A[j][i] = Temp - C;
}
for i = 1 to n do
for j = 1 to n do
output (A[i][j]);Single correct
MultiDequeue(Q){
m = k
while (Q is not empty) and (m > 0) {
Dequeue(Q)
m = m - 1
}
}
What is the worst case time complexity of a sequence of queue operations on an initially empty queue?Single correct
Answer key coming soon
Single correct
Answer key coming soon