adplus-dvertising

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.

frame-decoration

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 7 of 30

Q61.
The value of j at the end of the execution of the following C program.

int incr(int i)
{
static int count = 0;
count = count + i;
return (count);
}
main()
{
int i,j;
for (i = 0; i <=4; i++)
j = incr(i);
}

a.

10

b.

4

c.

6

d.

7

Discuss
Answer: (a).10
Q62.
Randomized quicksort is an extension of quicksort where the pivot is chosen randomly. What is the worst case complexity of sorting n numbers using randomized quicksort?
Discuss
Answer: (c).O(n^2)
Q63.
Consider any array representation of an n element binary heap where the elements are stored from index 1 to index n of the array. For the element stored at index i of the array (i <= n), the index of the parent is
Discuss
Answer: (b).floor(i/2)
Q64.
What is the minimum number of stacks of size n required to implement a queue of size n?
Discuss
Answer: (b).Two
Q65.
What is printed by the print statements in the program P1 assuming call by reference parameter passing?

Program P1()
{
x = 10;
y = 3;
func1(y,x,x);
print x;
print y;
}
func1(x,y,z)
{
y = y+4;
z = x+y+z;
}
Discuss
Answer: (b).31, 3
Q66.
Consider the following three C functions :

[PI] int * g (void)
{
int x= 10;
return (&x);
}

[P2] int * g (void)
{
int * px;
*px= 10;
return px;
}

[P3] int *g (void)
{
int *px;
px = (int *) malloc (sizeof(int));
*px= 10;
return px;
}

Which of the above three functions are likely to cause problems with pointers?
Discuss
Answer: (c).Only P1 and P2
Q67.
Consider the following program

Program P2
var n: int:
procedure W(var x: int)
begin
x=x+1;
print x;
end

procedure D
begin
var n: int;
n=3;
W(n);
end
begin //beginP2
n=10;
D;
end

If the language has dynamic scoping and parameters are passed by reference, what will be printed by the program?
Discuss
Answer: (d).None of the above
Discuss
Answer: (b).The number of activation records between the current activation record and the activation record for the main depends on the actual function calling sequence
Q69.
The results returned by functions under value-result and reference parameter passing conventions
Discuss
Answer: (d).May differ in the presence of exceptions
Q70.
Consider the following declaration of a two dimensional array in C:

char a[100][100];

Assuming that the main memory is byte-addressable and that the array is stored starting from memory address 0, the address of a [40][50] is :
Discuss
Answer: (b).4050

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!