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

Q71.
The number of leaf nodes in a rooted tree of n nodes, with each node having 0 or 3 children is:
Discuss
Answer: (d).(2n + 1)/3
Q72.
Consider the following algorithm for searching for a given number x in an unsorted array A[1.....n] having n distinct values:

1. Choose an i uniformly at random from 1..... n;
2. If A[i] = x then Stop else Goto 1;

Assuming that x is present in A, what is the expected number of comparisons made by the algorithm before it terminates ?
Discuss
Answer: (a).n
Q73.
The running time of the following algorithm Procedure A(n)

If n < = 2 return (1)
else return (A(Image not present√nImage not present));

is best described by :
Discuss
Answer: (c).O(log Log n)
Q74.
A weight-balanced tree is a binary tree in which for each node, the number of nodes in the left subtree is at least half and at most twice the number of nodes in the right subtree. The maximum possible height (number of nodes on the path from the root to the furthest leaf) of such a tree on n nodes is best described by which of the following?
Discuss
Answer: (d).log3/2 n
Q75.
Consider the following C function.

float f(float x, int y)
{
float p, s; int i;
for (s=1, p=1, i=1; i < y; i ++)
{
p*= x/i;
s+=p;
}
return s;
}

For large values of y, the return value of the function f best approximates
Discuss
Answer: (b).e^x
Q76.
Assume the following C variable declaration

int *A [10], B[10][10]; 

Of the following expressions:

I A[2]
II A[2][3]
III B[1]
IV B[2][3]

which will not give compile-time errors if used as left hand sides of assignment statements in a C program?
Discuss
Answer: (a).I, II, and IV only
Q77.
Suppose the numbers 7, 5, 1, 8, 3, 6, 0, 9, 4, 2 are inserted in that order into an initially empty binary search tree. The binary search tree uses the usual ordering on natural numbers. What is the in-order traversal sequence of the resultant tree ?
Discuss
Answer: (c).0 1 2 3 4 5 6 7 8 9
Q78.
Consider the following three claims

1. (n + k)^m = Θ(n^m), where k and m are constants
2. 2^(n + 1) = O(2^n)
3. 2^(2n + 1) = O(2^n)

Which of these claims are correct ?
Discuss
Answer: (a).1 and 2
Q79.
Consider the following graph. Among the following sequences

I) a b e g h f
II) a b f e h g
III) a b f h g e
IV) a f g h b e

Which are depth first traversals of the above graph?
Discuss
Answer: (d).I, III and IV only
Q80.
The unusual Θ(n^2) implementation of Insertion Sort to sort an array uses linear search to identify the position where and element is to be inserted into the already sorted part of the array. If, instead, we use binary search to identify the position, the worst case running time will
Discuss
Answer: (a).remain Θ(n^2)

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!