Welcome to the Data Structures and Algorithms MCQs Page
Dive deep into the fascinating world of Data Structures and Algorithms with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Data Structures and Algorithms, a crucial aspect of GATE CSE Exam. In this section, you will encounter a diverse range of MCQs that cover various aspects of Data Structures and Algorithms, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within GATE CSE Exam.
Check out the MCQs below to embark on an enriching journey through Data Structures and Algorithms. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of GATE CSE Exam.
Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Data Structures and Algorithms. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!
Data Structures and Algorithms MCQs | Page 10 of 30
Explore more Topics under GATE CSE Exam
for (k = 3; k < = n; k++)
A[k] = 0;
for (k = 2; k < = TwoLog_n; k++)
for (j = k + 1; j < = n; j++)
A[j] = A[j] || (j % k);
for (j = 3; j < = n; j++)
if (!A[j]) printf("%d", j);
The set of numbers printed by this program fragment is
#define print(x) printf("%d ", x)
int x;
void Q(int z)
{
z += x;
print(z);
}
void P(int *y)
{
int x = *y + 2;
Q(x);
*y = x - 1;
print(x);
}
main(void)
{
x = 5;
P(&x);
print(x);
}
The output of this program is
void swap (int a, int b)
{
int temp;
temp = a;
a = b;
b = temp;
}
In order to exchange the values of two variables x and y.
int f(int n)
{
static int i = 1;
if (n >= 5)
return n;
n = n+i;
i++;
return f(n);
}
The value returned by f(1) is
int n, rev;
rev = 0;
while (n > 0)
{
rev = rev*10 + n%10;
n = n/10;
}
The loop invariant condition at the end of the ith iteration is:
char p[20];
char *s = "string";
int length = strlen(s);
int i;
for (i = 0; i < length; i++)
p[i] = s[length — i];
printf("%s",p);
The output of the program is
i. getld is implemented in the superclass
ii. getld is implemented in the subclass
iii. getName is an abstract function in the superclass
iv. getName is implemented in the superclass
v. getName is implemented in the subclass
vi. getSalary is an abstract function in the superclass
vii. getSalary is implemented in the superclass
viii. getSalary is implemented in the subclass.
Choose the best design.
Suggested Topics
Are you eager to expand your knowledge beyond Data Structures and Algorithms? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!