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

Q51.
The most appropriate matching for the following pairs

X: depth first search 1: heap
Y: breadth-first search 2: queue
Z: sorting 3: stack

is
Discuss
Answer: (c).X—3, Y—2, Z--1
Q52.
Consider the following nested representation of binary trees: (X Y Z) indicates Y and Z are the left and right sub stress, respectively, of node X. Note that Y and Z may be NULL, or further nested. Which of the following represents a valid binary tree?
Discuss
Answer: (c).(1 (2 3 4)(5 6 7))
Q53.
Let s be a sorted array of n integers. Let t(n) denote the time taken for the most efficient algorithm to determined if there are two elements with sum less than 1000 in s. which of the following statements is true?

a) t (n) is O(1)
b) n < t (n) < n log2n
c) n log 2 n < t (n) < (n/2)
d) t (n) = [/Tex]{n \choose 2} [/Tex]

a.

a

b.

b

c.

c

d.

d

Discuss
Answer: (a).a
Discuss
Answer: (a).multiple variables having the same memory location
Q55.
Consider the following C declaration

struct {
short s [5]
union {
float y;
long z;
}u;
} t;

Assume that objects of the type short, float and long occupy 2 bytes, 4 bytes and 8 bytes, respectively. The memory requirement for variable t, ignoring alignment considerations, is
Discuss
Answer: (c).18 bytes
Q56.
The number of tokens in the following C statement

printf("i = %d, &i = %x", i, &i);

is
Discuss
Answer: (c).10
Discuss
Answer: (b).Disk access is much slower than memory access
Q58.
Suppose you are given an array s[1..n] and a procedure reverse (s, i, j) which reverses the order of elements in a between positions i and j (both inclusive). What does the following sequence do, where 1 <= k <= n:

reverse(s, 1, k) ;
reverse(s, k + 1, n);
reverse(s, l, n);
Discuss
Answer: (a).Rotates s left by k positions
Q59.
Let LASTPOST, LASTIN and LASTPRE denote the last vertex visited in a postorder, inorder and preorder traversal, respectively, of a complete binary tree. Which of the following is always true?
Discuss
Answer: (d).None of the above
Q60.
Consider the following functions. Which of the following is true?
Discuss
Answer: (d).f(n) is O(g(n))
Page 6 of 30

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!