Explore topic-wise MCQs in Data Structures Mcqs.

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

1.

In .. the difference between the height of the left sub tree and height of right sub tree, for each node, is not more than one.

A. BST
B. Complete Binary Tree
C. AVL-tree
D. Balanced Search tree
Answer» D. Balanced Search tree
2.

The maximum number of nodes in a binary tree of depth 5 is

A. 31
B. 16
C. 32
D. 15
Answer» B. 16
3.

. Is a directed tree in which out degree of each node is less than or equal to two.

A. Unary tree
B. Binary tree
C. Trinary tree
D. Both B and C
Answer» C. Trinary tree
4.

A B-tree of minimum degree t can maximum _____ pointers in a node.

A. T 1
B. 2t 1
C. 2t
D. T
Answer» E.
5.

A binary search tree whose left subtree and right subtree differ in height by at most 1 unit is called

A. AVL tree
B. Red-black tree
C. Lemma tree
D. None of the above
Answer» B. Red-black tree
6.

A binary tree is said to be a complete binary tree if all the leaf nodes of the tree are at ________.

A. Same level
B. Opposite level
C. Different level
D. Adjacent level
Answer» B. Opposite level
7.

A binary tree is said to be an extended binary tree (also known as 2-tree) if all of its nodes are of _______.

A. Zero degree
B. Two degrees
C. Both (a) and b)
D. None of the above
Answer» D. None of the above
8.

A binary tree of depth d is an almost complete binary tree if

A. Each leaf in the tree is either at level d or at level d 1
B. For any node n in the tree with a right descendent at level d all the left descendents of n that are leaves, are also at level d
C. Both a and b
D. None of the above
Answer» D. None of the above
9.

A binary tree stored using linked representation can be converted to its mirror image by traversing it in

A. In-order
B. Pre-order
C. Post-order
D. Any order
Answer» C. Post-order
10.

A BST is traversed in the following order recursively: Right, root, left. The output sequence will be in

A. Ascending order
B. Descending order
C. Bitomic sequence
D. No specific order
Answer» C. Bitomic sequence
11.

A complete Binary Tree with 15 nodes contains .. edges.

A. 15
B. 30
C. 14
D. 16
Answer» D. 16
12.

A complete binary tree with n leaf nodes has ..

A. N+1 nodes
B. 2n-1 nodes
C. 2n+1 nodes
D. n(n-1)/2 nodes
Answer» C. 2n+1 nodes
13.

A complete binary tree with the property that the value at each node is at least as large as the values at its children is called

A. Heap
B. Binary Tree
C. Binary search tree
D. Completely balanced tree
Answer» B. Binary Tree
14.

A tree in which, for every node, the difference between the height of its left subtree and right subtree is not more than one is

A. Complete Binary Tree
B. B Tree
C. B+ Tree
D. AVL Tree
Answer» E.
15.

A __________is a non-linear data structure representing the hierarchical structure of one or more elements known as nodes.

A. Tree
B. Child nodes
C. Leaf nodes
D. None of the above
Answer» B. Child nodes
16.

A-2-3 tree is a tree such that 1. All internal nodes have either 2 or 3 children. 2. All paths from root to the leaves have the same length. The number of internal nodes of a 2-3 tree having 9 leaves could be

A. 2
B. 4
C. 6
D. 8
Answer» C. 6
17.

A full binary tree with 2n+1 nodes contain

A. N leaf nodes
B. N non-leaf nodes
C. n-1 leaf nodes
D. N-1 non-leaf nodes
Answer» C. n-1 leaf nodes
18.

A full binary tree with n non-leaf nodes contains

A. 2n nodes
B. N - 1 nodes
C. Log2n nodes
D. 2n + 1 nodes
Answer» E.
19.

A list integers is read in, one at a time, and a binary search tree is constructed. Next the tree is traversed would result in a printout which duplicates the original order of the list of integers?

A. Inorder
B. Preorder
C. Postorder
D. None of these
Answer» E.
20.

Access time of a binary search tree may go worse in terms of time complexity upto

A. (n2)
B. (n log n)
C. (n)
D. (1)
Answer» D. (1)
21.

All possible spanning trees of graph G

A. Have same number of edges and vertices.
B. Have same number of edges and but not vertices.
C. Have same number of vertices but not edges.
D. Depends upon algorithm being used.
Answer» B. Have same number of edges and but not vertices.
22.

An array consist of n elements. We want to create a heap using the elements. The time complexity of building a heap will be in order of

A. O(n*n*logn)
B. O(n*logn)
C. O(n*n)
D. O(n *logn *logn)
Answer» C. O(n*n)
23.

Any node is the path from the root to the node is called

A. Successor node
B. Ancestor node
C. Internal node
D. None of the above
Answer» C. Internal node
24.

AVL trees have LL, LR, RR, RL rotations to balance the tree to maintain the balance factor (LR : Insert node in Right sub tree of Left sub tree of node A, etc). Among rotations the following are single and double rotations

A. LL, RL and LR, RR
B. LL, RR and LR, RL
C. LR, RR and LL, RL
D. LR, RL and LR, RL Answer: B
Answer» C. LR, RR and LL, RL
25.

B+- trees are preferred to binary trees in databases because

A. Disk access is much slower than memory Access
B. Disk capacities are greater than memory capacities
C. Disk data transfer rates are much less than memory data transfer rates
D. All of above
Answer» B. Disk capacities are greater than memory capacities
26.

Binary search tree has best case run-time complexity of (log n). What could the worst case?

A. (n)
B. (n2)
C. (n3)
D. None of the above
Answer» B. (n2)
27.

A complete binary tree with the property that the value of each node is at least as large as the values of its children is known as ..

A. Binary Search Tree
B. AVL Tree
C. Heap
D. Threaded Binary Tree
Answer» D. Threaded Binary Tree
28.

A binary search tree, also known as_________.

A. Binary tree
B. Binary sorted tree
C. Sibling node
D. Heap trees
Answer» C. Sibling node
29.

A binary tree can be converted in to its mirror image by traversing it in ..

A. In-order
B. Pre-order
C. Post-order
D. Any order
Answer» C. Post-order
30.

A binary tree can easily be converted into a 2-tree

A. By replacing each empty sub tree by a new internal node
B. By inserting an internal nodes for non-empty node
C. By inserting an external nodes for non-empty node
D. By replacing each empty sub tree by a new external node
Answer» E.
31.

A binary tree having n nodes and depth d will be about complete binary tree if

A. It contains log(d)+1 nodes
B. Any node nd at level less than d-1 has two sons
C. For any node nd in the tree with a right descendent at level d lt must have a left son
D. All of these
Answer» C. For any node nd in the tree with a right descendent at level d lt must have a left son
32.

A binary tree in which every non-leaf node has non-empty left and right subtrees is called a strictly binary tree. Such a tree with 10 leaves

A. Has exactly 17 nodes
B. Has exactly 19 nodes
C. Cannot have more than 19 nodes
D. None of these
Answer» C. Cannot have more than 19 nodes
33.

A binary tree in which if all its levels except possibly the last, have the maximum number of nodes and all the nodes at the last level appear as far left as possible, is called

A. Threaded tree
B. Full binary tree
C. Binary Search Tree
D. Complete binary tree
Answer» E.
34.

A binary tree in which if all its levels except possibly the last, have the maximum number of nodes and all the nodes at the last level appear as far left as possible, is known as

A. Full binary tree
B. AVL tree
C. Threaded tree
D. Complete binary tree
Answer» B. AVL tree
35.

A binary tree is a special type of tree, which can either be empty or have a finite set of nodes, such that, one of the nodes is designated as the root node and the remaining nodes are partitioned into sub trees of the root nodes known as__________.

A. Left sub tree
B. Right sub tree
C. Both (a) and (b)
D. Heap tree
Answer» D. Heap tree
36.

A binary tree is a ________data structure; each node belongs to a particular level number.

A. Dual level
B. Multilevel
C. Tri level
D. Single level
Answer» C. Tri level
37.

A binary tree is generated by inserting in order the following integers: 50, 15, 62, 5, 20,58, 91, 3,8,37, 60, 24 The number of nodes in the left of the root respectively is

A. (3,6)
B. (4,7)
C. (6,3)
D. (7,4)
Answer» E.
38.

What must be the missing logic below so as to print mirror of a tree as below as an example?

A. Swapping of left and right nodes is missing
B. Swapping of left with root nodes is missing
C. Swapping of right with root nodes is missing
D. Nothing is missing
Answer» B. Swapping of left with root nodes is missing
39.

What must be the missing logic in place of missing lines for finding sum of nodes of binary tree in alternate levels?

A. A
B. B
C. C
D. D
Answer» B. B
40.

What output does the below pseudo code produces?

A. Right rotation of subtree
B. Left rotation of subtree
C. Zig-zag operation
D. Zig-zig operation
Answer» B. Left rotation of subtree
41.

What will be the order of new heap created after union of heap H1 and H2 when created by the following code.Initially both are of the order n.

A. N+1
B. N+n/2
C. Nlogn
D. 2*n
Answer» B. N+n/2
42.

What is wrong with below code for inorder traversal of inorder threaded binary tree:

A. Inordersuccessor instead of inorderpredecessor must be done
B. Code is correct
C. It is code for post order
D. It is code for pre order
Answer» B. Code is correct
43.

What is wrong with the following code of insertion in fibonacci heap.Choose the correct option

A. Line -11
B. Line -3
C. Line 9
D. Line 7
Answer» D. Line 7
44.

When representing any algebraic expression E which uses only binary operations in a 2-tree,

A. The variable in E will appear as external nodes and operations in internal nodes
B. The operations in E will appear as external nodes and variables in internal nodes
C. The variables and operations in E will appear only in internal nodes
D. The variables and operations in E will appear only in external nodes
Answer» B. The operations in E will appear as external nodes and variables in internal nodes
45.

Which amongst the following cannot be a balance factor of any node of an AVL tree?

A. 1
B. 0
C. 2
D. -1
Answer» D. -1
46.

Which concept is useful while writing programming code for implementing various operations on trees?

A. Recursion
B. Huffman s algorithm
C. Internal nodes
D. None of the above
Answer» B. Huffman s algorithm
47.

Which code for an alphabet (set of symbols) is generated by constructing a binary tree with nodes containing the symbols to be encoded and their probabilities of occurrence?

A. Algorithm
B. Hughman code
C. Huffman code
D. Canonical Huffman codes
Answer» D. Canonical Huffman codes
48.

Which line connects any two nodes?

A. Edge
B. Depth
C. Level
D. None of the above
Answer» B. Depth
49.

Which method can find if two vertices x & y have path between them?

A. Depth First Search
B. Breadth First Search
C. Both A & B
D. None A or B
Answer» D. None A or B
50.

Which of the below diagram is following AVL tree property?

A. Only i
B. Only i and ii
C. Only ii
D. None of the mentioned
Answer» C. Only ii