Explore topic-wise MCQs in Data Structures and Algorithms.

This section includes 89 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structures and Algorithms knowledge and support exam preparation. Choose a topic below to get started.

1.

What is the time complexity for searching a key or integer in Van Emde Boas data structure?

A. O (log M!)
B. O (M!)
C. O (M2)
D. O (log (log M))
Answer» E.
2.

Can operation like Find Next and Find Previous be implemented.

A. True
B. False
Answer» B. False
3.

___________ is one of the earliest forms of a self-adjustment strategy used in splay trees, skew heaps.

A. Union by rank
B. Equivalence function
C. Dynamic function
D. Path compression
Answer» E.
4.

Which of the following is the simplest data structure that supports range searching?

A. Heaps
B. binary search trees
C. AA-trees
D. K-d trees
Answer» E.
5.

In a k-d tree, k originally meant?

A. number of dimensions
B. size of tree
C. length of node
D. weight of node
Answer» B. size of tree
6.

How many child nodes does each node of Ternary Tree contain?

A. 4
B. 6
C. 5
D. 3
Answer» E.
7.

What is the height of a K-ary tree having only root node?

A. 1
B. 0
C. 2
D. 3
Answer» C. 2
8.

What is the depth of the root node of K-ary tree?

A. 2
B. 1
C. 0
D. 3
Answer» D. 3
9.

What is the Height of the root node of K-ary tree?

A. 1
B. 2
C. 3
D. 0
Answer» E.
10.

How many strategies are followed to solve a dynamic equivalence problem?

A. 1
B. 2
C. 3
D. 4
Answer» C. 3
11.

Which operation find the value associated with a given key?

A. Insert
B. Find Next
C. Look up
D. Delete
Answer» C. Look up
12.

Only infix expression can be made into an expression tree.

A. true
B. false
Answer» C.
13.

In a two-dimensional search tree, the root is arbitrarily chosen to be?

A. even
B. odd
C. depends on subtrees
D. 1
Answer» C. depends on subtrees
14.

The leaves of an expression tree always contain?

A. operators
B. operands
C.
Answer» C.
15.

Which one of the following is the correct formulae to find the parent node at index I?

A. (I-1)/K
B. (I+1)/K
C. (I*1)/K
D. (I-2)/K
Answer» B. (I+1)/K
16.

Each level in a k-d tree is made of?

A. dimension only
B. cutting and dimension
C. color code of node
D. size of the level
Answer» C. color code of node
17.

Several kinds of queries are possible on a k-d called as?

A. partial queries
B. range queries
C. neighbour queries
D. search queries
Answer» C. neighbour queries
18.

In the Union/Find algorithm, the ranks of the nodes on a path will increase monotonically from?

A. leaf to root
B. root to node
C. root to leaf
D. left subtree to right subtree
Answer» B. root to node
19.

When executing a sequence of Unions, a node of rank r must have at least 2r descendants.

A. true
B. false
Answer» B. false
20.

Which type of tree does Van Emde Boas require to perform basic operations?

A. Unbalanced
B. Balanced
C. Complete
D. Non – Binary
Answer» E.
21.

What is the Height of the root node of ternary tree?

A. 1
B. 2
C. 3
D. 0
Answer» E.
22.

Can leaf node be called child node in a K-ary tree?

A. True
B. false
Answer» B. false
23.

Can leaf node be called child node in a ternary tree?

A. True
B. False
Answer» B. False
24.

What is the worst case of finding the nearest neighbour?

A. O(N)
B. O(N log N)
C. O( log N)
D. O(N3)
Answer» B. O(N log N)
25.

What is the total time spent for N-1 merges in a dynamic equivalence problem?

A. O(N)
B. O(log N)
C. O(N log N)
D. O(M log N)
Answer» D. O(M log N)
26.

What is the definition for Ackermann's function?

A. A(1,i) = i+1 for i>=1
B. A(i,j) = i+j for i>=j
C. A(i,j) = i+j for i = j
D. A(1,i) = i+1 for i<1
Answer» B. A(i,j) = i+j for i>=j
27.

What is the depth of the root node of the ternary tree?

A. 2
B. 1
C. 0
D. 3
Answer» D. 3
28.

How many extra nodes are there in Full K-ary tree than complete K-ary tree?

A. 1
B. 2
C. 3
D. Both have same number of nodes
Answer» E.
29.

What is the time complexity for inserting a key or integer in Van Emde Boas data structure?

A. O (log M!)
B. O (M!)
C. O (M2)
D. O (log (log M))
Answer» B. O (M!)
30.

The expression obtained by recursively producing a left expression, followed by an operator, followed by recursively producing a right expression is called?

A. prefix expression
B. infix expression
C. postfix expression
D. paranthesized expression
Answer» C. postfix expression
31.

A relation R on a set S, defined as x R y if and only if y R x. This is an example of?

A. reflexive relation
B. symmetric relation
C. transitive relation
D. invalid relation
Answer» C. transitive relation
32.

Reducing search space by eliminating irrelevant trees is known as?

A. pruning
B. partial results
C. freeing space
D. traversing
Answer» B. partial results
33.

What is the value for the number of nodes of rank r?

A. N
B. N/2
C. N/2r
D. Nr
Answer» D. Nr
34.

Which of the following is the implementation of the ternary tree?

A. AVL Tree
B. Ternary Heap
C. Hash Table
D. Dictionary
Answer» C. Hash Table
35.

What is the time complexity for deleting a key or integer in Van Emde Boas data structure?

A. O (log M!)
B. O (log (log M))
C. O (M!)
D. O (M2)
Answer» C. O (M!)
36.

An expression tree is a kind of?

A. Binary search tree
B. Fibonacci tree
C. Binary tree
D. Treap
Answer» D. Treap
37.

What is the upper bound for maximum leaves in K-ary tree with height h?

A. K*h
B. K^h
C. K+h
D. K-h
Answer» C. K+h
38.

Electrical connectivity is an example of equivalence relation.

A. true
B. false
Answer» B. false
39.

The average depth of a binary tree is given as?

A. O(N)
B. O(log N)
C. O(M log N)
D. O(√N)
Answer» E.
40.

A node can have a minimum of one child.

A. true
B. false
Answer» B. false
41.

Which of the following is false about Prim's algorithm?

A. It is a greedy algorithm
B. It constructs MST by selecting edges in increasing order of their weights
C. It never accepts cycles in the MST
D. It can be implemented using the Fibonacci heap
Answer» C. It never accepts cycles in the MST
42.

Which of the following is false in the case of a spanning tree of a graph G?

A. It is tree that spans G
B. It is a subgraph of the G
C. It includes every vertex of the G
D. It can be either cyclic or acyclic
Answer» E.
43.

Which of the following is not the algorithm to find the minimum spanning tree of the given graph?

A. Boruvka's algorithm
B. Prim's algorithm
C. Kruskal's algorithm
D. Bellman-Ford algorithm
Answer» E.
44.

Which of the following is false about the Kruskal's algorithm?

A. It is a greedy algorithm
B. It constructs MST by selecting edges in increasing order of their weights
C. It can accept cycles in the MST
D. It uses union-find data structure
Answer» D. It uses union-find data structure
45.

The travelling salesman problem can be solved using _________

A. A spanning tree
B. A minimum spanning tree
C. Bellman – Ford algorithm
D. DFS traversal
Answer» C. Bellman – Ford algorithm
46.

Consider the following statements.S1. Kruskal's algorithm might produce a non-minimal spanning tree.S2. Kruskal's algorithm can efficiently implemented using the disjoint-set data structure.

A. S1 is true but S2 is false
B. Both S1 and S2 are false
C. Both S1 and S2 are true
D. S2 is true but S1 is false
Answer» E.
47.

Does path compression algorithm work during?

A. Create operation
B. Insert operation
C. Find operation
D. Delete operation
Answer» D. Delete operation
48.

What is the time complexity for storing the maximum number of elements in Van Emde Boas tree if M is the maximum number of elements?

A. O (log M)
B. O (M!)
C. O (M)
D. O (1)
Answer» D. O (1)
49.

Kruskal's algorithm is a ______

A. divide and conquer algorithm
B. dynamic programming algorithm
C. greedy algorithm
D. approximation algorithm
Answer» D. approximation algorithm
50.

Who Invented The vEB also known as Van Emde Boas Tree?

A. Peter Van Emde Boas
B. Samuel F. B. Morse
C. Friedrich Clemens Gerke
D. Alexander Morse
Answer» E.