0% found this document useful (0 votes)
24 views33 pages

Dsa

The document consists of a series of questions related to various data structures, their properties, and their applications. It covers linear and non-linear data structures, time complexities, and specific use cases for structures like stacks, queues, trees, and hash tables. The questions also address sorting algorithms and their complexities, as well as operations that can be performed on these data structures.

Uploaded by

garaisubhajit343
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views33 pages

Dsa

The document consists of a series of questions related to various data structures, their properties, and their applications. It covers linear and non-linear data structures, time complexities, and specific use cases for structures like stacks, queues, trees, and hash tables. The questions also address sorting algorithms and their complexities, as well as operations that can be performed on these data structures.

Uploaded by

garaisubhajit343
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 33

Dsa

1. Which of the following is not a linear data structure?

1) Array

2) Linked list

3) Stack

4) Tree

2. Which data structure is best suited for implementing a LIFO (Last-In-First-Out)


structure?

1) Queue

2) Linked list

3) Stack

4) Tree

3. Which of the following data structures can be used to implement a priority


queue?

1) Array

2) Linked list

3) Queue

4) Binary heap

4. Which data structure is used for efficient search, insertion and deletion
operations?

1) Array

2) Linked list

3) Stack

4) Tree

5. Which of the following data structures is a non-linear data structure?

1) Array

2) Linked list

3) Stack

4) Tree

6. Which data structure uses the FIFO (First-In-First-Out) principle?

1) Stack

191
2) Linked list

3) Queue

4) Tree

7. Which data structure is used for searching, sorting and merging operations?

1) Array

2) Linked list

3) Stack

4) Tree

8. Which of the following is not a type of tree data structure?

1) Binary tree

2) AVL tree

3) Heap tree

4) Linked list

9. Which data structure uses a combination of both array and linked list
structures?

1) Stack

2) Queue

3) Hash table

4) Deque

10. Which data structure is used for storing key-value pairs and offers fast
insertion, deletion and lookup operations?

1) Array

2) Linked list

3) Hash table

4) Binary search tree

11. Which data structure is used to store a collection of elements in a specific


order?

1) Stack

2) Queue

3) Linked List

4) Array
12. Which data structure allows access to its elements in constant time, regardless
of the size of the data?

1) Stack

2) Queue

3) Linked List

4) Hash Table

13. Which data structure uses a binary tree to store its elements?

1) Stack

2) Queue

3) Heap

4) Hash Table

14. Which data structure is a collection of key-value pairs where each key is
associated with a value?

1) Stack

2) Queue

3) Linked List

4) Hash Table

15. Which data structure is a list of nodes where each node points to its
successor?

1) Stack

2) Queue

3) Linked List

4) Tree

16. Which data structure is based on the principle of last-in-first-out (LIFO)?

1) Stack

2) Queue

3) Linked List

4) Tree

17. Which data structure is based on the principle of first-in-first-out (FIFO)?

1) Stack

2) Queue
192

3) Linked List

4) Tree

18. Which data structure uses a set of rules to determine which element to remove
when there is a conflict during insertion?

1) Stack

2) Queue

3) Linked List

4) Tree

19. Which data structure is used to represent a hierarchical structure?

1) Stack

2) Queue

3) Linked List

4) Tree

20. Which data structure is used to store elements in a sorted order?

1) Stack

2) Queue

3) Linked List

4) Tree

21. Which of the following is not a linear data structure?

1) Array

2) Linked List

3) Stack

4) Tree

22. What is the time complexity of accessing an element in an array?

1) 0(1)

2) O(log n)

3) O(n)

4) O(n^2)

23. Which data structure uses Last-In-First-Out (LIFO) behavior?


1) Queue

2) Stack

3) Linked List

4) Binary Tree

24. Which sorting algorithm has the worst-case time complexity of O(n^2)?

1) Quick Sort

2) Merge Sort

3) Heap Sort

4) Bubble Sort

25. What is the time complexity of searching for an element in a hash table in the
worst case?

1) 0(1)

2) O(log n)

3) O(n)

4) O(n^2)

26. Which data structure allows you to access elements from both ends in constant
time?

1) Queue

2) Stack

3) Linked List

4) Deque

27. Which of the following data structures does not store elements in a contiguous
block of memory?

1) Array

2) Linked List

3) Stack

4) Queue

28. Which data structure is used to implement a FIFO (First- In-First-Out)


behavior?

1) Queue

2) Stack
3) Linked List

4) Binary Tree

29. What is the time complexity of merging two sorted arrays of size n and m?

1) O(n)

2) O(m)

193

3) O(n log m)

4) O(n+m)

30. Which data structure is used to implement the heap data structure?

1) Linked List

2) Stack

3) Queue

4) Array

31. Which of the following is not a linear data structure?

1) Array

2) Linked List

3) Stack

4) Tree

32. Which of the following data structures uses a "last in, first out" (LIFO)
ordering?

1) Queue

2) Stack

3) Binary Tree

4) Heap

33. What is the time complexity of searching for an element in a binary search
tree?

1) 0(1)

2) O(log n)

3) O(n)

4) O(n^2)

34. Which of the following sorting algorithms has the best worst-case time
complexity?

1) Bubble Sort

2) Quick Sort

3) Selection Sort

4) Insertion Sort

35. Which of the following data structures uses a "first in, first out" (FIFO)
ordering?

1) Queue

2) Stack

3) Binary Tree

4) Heap

36. Which of the following is not a type of tree data structure?

1) Binary Tree

2) Trie

3) AVL Tree

4) Hash Table

37. What is the time complexity of finding an element in a hash table in the
average case?

1) 0(1)

2) O(log n)

3) O(n)

4) O(n^2)

38. Which data structure allows you to access elements from both ends in constant
time?

1) Queue

2) Stack

3) Linked List

4) Deque

39. Which of the following is not a type of graph data structure?

1) Directed Graph

2) Undirected Graph
3) Tree Graph

4) Weighted Graph

40. Which data structure is typically used to implement a priority queue?

1) Queue

2) Stack

3) Heap

4) Linked List

41. Which of the following data structures is used to represent a hierarchy?

1) Stack

2) Queue

3) Tree

4) Hash Table

194

42. What is the time complexity of merging two sorted arrays of size n and m?

1) O(n)

2) O(m)

3) O(n log m)

4) O(n+m)

43. Which of the following data structures is used to store and manipulate data in
the form of key-value pairs?

1) Array

2) Linked List

3) Hash Table

4) Binary Tree

44. Which of the following is not a common application of stacks?

1) Expression Evaluation

2) Reverse a String

3) Depth-First Search

4) Breadth-First Search

45. Which of the following is not a common application of queues?


1) Breadth-First Search

2) Round-Robin Scheduling

3) Depth-First Search

4) Task Processing

46. Which of the following data structures is used to implement a graph data
structure?

1) Linked List

2) Stack

3) Queue

4) Adjacency List

47. Which of the following data structures is used to implement a binary search?

1) Stack

2) Queue

3) Linked List

4) Array

48. Which of the following is not a type of hash function?

1) Division Method

2) Multiplication Method

3) Mid-Square Method

4) All of the above are types of hash functions.

49. Which of the following is not a common application of trees?

1) File System Organization

2) Network Routing Algorithms

3) Huffman Coding

4) All of the above are common applications of trees.

50. Which data structure uses the "last-in, first-out" (LIFO) principle?

a) Queue

b) Stack

c) Linked List

d) Tree
51. What is the worst-case time complexity of searching an element in a binary
search tree?

a) 0(1)

b) O(n)

c) O(log n)

d) O(n log n)

52. Which of the following is not a linear data structure?

a) Stack

b) Queue

c) Linked List

d) Binary Tree

53. Which data structure allows elements to be inserted and deleted from both ends?

a) Stack

b) Queue

c) Deque

d) Linked List

54. What is the maximum number of child nodes a node can have in a binary tree?

a) 1

b) 2

c) 3

d) Unlimited

55. Which of the following sorting algorithms has the worst-case time complexity of
O(n^2)?

a) Bubble Sort

b) Merge Sort

c) Quick Sort

d) Insertion Sort

56. Which of the following data structures is best suited for implementing a
priority queue?

a) Stack

b) Queue
c) Heap

d) Linked List

57. Which of the following operations can be performed in constant time in a hash
table?

a) Insert

b) Delete

c) Search

d) All of the above

58. Which of the following data structures is a dynamic set data structure that
supports O(1) search, insert, and delete operations?

a) Stack

b) Queue

c) Heap

d) Hash Table
59. Which of the following data structures is used to implement a graph?

a) Array

b) Stack

c) Queve

d) Adjacency List

60. What is the time complexity of searching for an element in an array?

a) O(n)

b) O(log n)

c) 0(1)

d) O(n log n)

61. Which data structure allows elements to be accessed in a random order?

a) Linked List

b) Stack

c) Queue

d) Array

62. What is the time complexity of inserting an element at the end of a singly
linked list?

a) 0(1)
b) O(n)

c) O(log n)

d) O(n log n)

63. Which data structure is based on the principle of "first-in, first-out" (FIFO)?

a) Stack

b) Queue

c) Linked List

d) Tree

64. Which of the following data structures is a collection of elements that allows
duplicate elements?

a) Set

b) Map

c) List

d) Queue

65. Which of the following data structures is a tree in which each node can have at
mou two children?

a) Binary Tree

b) Ternary Tree

c) Quadtree

d) Octree

66. Which of the following data structures is used to implement a stack?

a) Array

b) Linked List

c) Queue

d) Hash Table

196

67. Which of the following sorting algorithms has a best-case time complexity of
O(n log n)?

a) Bubble Sort

b) Insertion Sort

c) Quick Sort
d) Merge Sort

68. Which data structure is a special case of a graph where there are no cycles?

a) Binary Tree

b) Directed Acyclic Graph (DAG)

c) Undirected Graph

d) Heap

69. Which of the following operations can be performed in constant time in a stack?

a) Insert

b) Delete

c) Search

d) Push and Pop

70. Which of the following dat structures uses a hash function to store and
retrieve data efficiently?

a) Linked List

b) Stack

c) Queue

d) Hash Table

71. What is the time complexity of finding the maximum or minimum element in a
binary heap?

a) O(n)

b) O(log n)

c) O(n log n)

d) 0(1)

72. Which of the following data structures is a collection of elements that are
stored in a sorted order?

a) Heap

b) Hash Table

c) Binary Search Tree

d) Stack

73. Which of the following data structures uses the "first-in, first-out" (FIFO)
principle?
a) Stack

b) Queue

c) Linked List

d) Tree

74. What is the time complexity of deleting an element from a binary search tree?

a) 0(1)

b) O(n)

c) O(log n)

d) O(n log n)

75. Which of the following data structures is used to implement a heap?

a) Array

b) Linked List

c) Queue

d) Stack

76. Which of the following data structures is used to implement a hash table?

a) Array

b) Linked List

c) Queue

d) Stack

77. Which of the following sorting algorithms has the worst-case time complexity of
O(n log n)?

a) Bubble Sort

b) Insertion Sort

c) Quick Sort

d) Merge Sort

78. Which data structure is used to implement a breadth-first search (BFS)


algorithm?

a) Queue

b) Stack

c) Linked List

d) Binary Search Tree


79., Which of the following operations can be performed in constant time in a
queue?

a) Insert

b) Delete

c) Search

d) Enqueue and Dequeue

80. Which of the following data structures allows for constant time access to an
element by its index?

a) Linked List

b) Stack

c) Queue

d) Array

81. Which of the following data structures is a tree in which each node has at most
one child?

a) Binary Tree

b) AVL Tree

c) B-Tree

d) Binary Search Tree

82. What is the time complexity of inserting an element at the beginning of a


singly linked list?

a) 0(1)

b) O(n)

c) O(log n)

d) O(n log n)

83. Which of the following data structures is a collection of elements that are
stored in a sorted order andallows for efficient insertion and deletion of
elements?

a) Heap

b) Hash Table

c) Binary Search Tree

d) Queue

84. Which of the following data structures is used to implement a priority queue?
a) Stack

b) Queue

c) Linked List

d) Heap

85. What is the time complexity of searching for an element in a binary search
tree?

a) 0(1)

b) O(n)

c) O(log n)

d) O(n log n)

86. Which of the following sorting algorithms has the best-case time complexity of
O(n)?

a) Bubble Sort

b) Insertion Sort

c) Selection Sort

d) Quick Sort

87. Which of the following data structures is used to

implement a disjoint set data structure?

a) Stack

b) Queue

c) Heap

d) Union-Find Data Structure

88. Which of the following data structures is used to implement a breadth-first


search (BFS) algorithm?

a) Queue

b) Stack

c) Linked List

d) Binary Search Tree

89. Which of the following operations can be performed in constant time in a hash
table?

a) Insert

b) Delete
c) Search

d) All of the above

90. Which of the following data structures is used to implement a LIFO (Last-In,
First-Out) behavior?

a) Stack

b) Queue

c) Linked List

d) Binary Search Tree

91. What is the worst-case time complexity of searching for an element in a hash
table?

a) 0(1)

b) O(log n)

c) O(n)

d) O(n log n)

92. Which of the following data structures is used to implement an ordered list
with no duplicates?

a) Heap

b) Binary Search Tree

c) Hash Table

d) Linked List

93. Which of the following data structures is used to implement a disjoint data
structure? set

a) Stack

b) Queue

c) Heap

d) Union-Find Data Structure

94. What is the time complexity of inserting an element at the end of a singly
linked list?

a) 0(1)

b) O(n)

c) O(log n)

d) O(n log n)
95. Which of the following sorting algorithms is an in- place sorting algorithm?

a) Merge Sort

b) Quick Sort

c) Heap Sort

d) Insertion Sort

96. Which of the following data structures is used to implement a balanced binary
search tree?

a) AVL Tree

b) B-Tree

c) Red-Black Tree

d) Trie

97. Which of the following data structures is used to implement a graph?

a) Array

b) Linked List

c) Queue

d) All of the above

98. What is the time complexity of finding the kth smallest

199

element in a binary search tree?

a) 0(1)

b) O(n)

c) O(log n)

d) O(n log n)

99. Which of the following operations can be performed in constant time in a stack?

a) Push

b) Pop

c) Peek

d) All of the above

100.Which of the following data structures is used to implement a FIFO (First-In,


First-Out) behavior?
a) Queue

b) Stack

c) Binary Search Tree

d) Heap

101.What is the worst-case time complexity of searching for an element in a binary


search tree?

a) 0(1)

b) O(log n)

c) O(n)

d) O(n log n)

102. Which of the following data structures is used to implement a priority queue?

a) Heap

b) Queue

c) Stack

d) Linked List

103. What is the time complexity of inserting an element into a binary searchtree?

a) 0(1)

b) O(log n)

c) O(n)

d) O(n log n)

104. Which of the following data structures is used to implement a set with no
duplicates?

a) Heap

b) Linked List

c) Hash Table

d) Binary Search Tree

105. Which of the following sorting algorithms has a worst-case time complexity of
O(n^2)?

a) Quick Sort

b) Heap Sort

c) Merge Sort
d) Insertion Sort

106. Which of the following data structures is used to implement a stack?

a) Linked List

b) Array

c) Queue

d) Heap

107.Which of the following data structures is used to implement a breadth-first


search on a graph?

a) Stack

b) Queue

c) Binary Search Tree

d) Heap

108. What is the time complexity of finding the maximum element in a max heap?

a) 0(1)

b) O(log n)

c) O(n)

d) O(n log n)

109.Which of the following operations can be performed in constant time in a hash


table?

a) Insertion

200

b) Deletion

c) Search

d) All of the above

110. Which of the following dita structures is used to implement a LIFO (Last
First-Out) behavior?

a) Queue

b) Stack

c) Binary Search Tree

d) Heap

111. What is the worst-case me complexity of inserting an element into a hash


table?
a) 0(1)

b) O(log n)

c) O(n)

d) O(n log n)

112. Which of the following data structures is used to implement a graph?

a) Heap

b) Queue

c) Stack

d) Adjacency List

113. What is the time complexity of finding an element in a hash table?

a) 0(1)

b) O(log n)

c) O(n)

d) O(n log n)

114. Which of the following dat structures is used to implement a deque (double-
ended queue)?

a) Queue

b) Stack

c) Linked List

d) Binary Search Tree

115. Which of the following sorting algorithms hasa worst-case time complext of O(n
log n)?
a) Quick Sort

b) Heap Sort

c) Merge Sort

d) Insertion Sort

116. Which of the following data structures is used to implement a priority queue
with a decrease-key operation?

a) Heap

b) Queue

c) Stack
d) Linked List

117.Which of the following data structures is used to implement a depth-first


search on a graph?

a) Stack

b) Queue

c) Binary Search Tree

d) Heap

118. What is the time complexity of finding the minimum element in a min heap?

a) 0(1)

b) O(log n)

c) O(n)

d) O(n log n)

119. Which of the following operations can be performed in constant time in a


circular buffer?

a) Insertion

b) Deletion

c) Search

d) None of the above

120. What is the time complexity of finding the kth smallest element in an unsorted
array?

a) O(n log n)

b) O(n)

c) O(n^2)

d) O(log n)

201

121. Which of the following data structures is used to implement a Red-Black Tree?

a) AVL Tree

b) Heap

c) Binary Search Tree

d) B-Tree

122. What is the time complexity of finding the maximum element in a max heap?
a) 0(1)

b) O(log n)

c) O(n)

d) O(n log n)

123. Which of the following data structures is used to implement a set that
maintains a sorted order of elements?

a) Binary Search Tree

b) AVL Tree

c) Hash Table

d) Heap

124. What is the time complexity of finding the shortest path between two vertices
in a weighted graph using Dijkstra's algorithm?

a) O(n log n)

b) O(n^2)

c) O(m log n)

d) 0(m+n log n)

125. Which of the following sorting algorithms has the worst space complexity?

a) Bubble Sort

b) Selection Sort

c) Quick Sort

d) Merge Sort

126. Which of the following data structures is used to implement a disjoint-set


data structure?

) Heap

b) Queue

c) Binary Search Tree

d) Union-Find Array

127. What is the time complexity of finding the median of a sorted array of size n?

a) 0(1)

b) O(log n)

c) O(n)
d) O(n log n)

128. Which of the following data structures is used to implement a Bloom Filter?

a) Hash Table

b) AVL Tree

c) Binary Search Tree

d) Bit Array

129. Which of the following algorithms is used to find the strongly connected
components in a directed graph?

a) Dijkstra's algorithm

b) Bellman-Ford algorithm

c) Kruskal's algorithm

d) Tarjan's algorithm

130.Which of the following algorithms is used to find the minimum spanning tree in
a weighted, connected graph?

a) Dijkstra's algorithm

b) Bellman-Ford algorithm

c) Kruskal's algorithm

d) Topological sort

131. Which of the following data structures is used to implement a Trie?

a) Binary Search Tree

b) Hash Table

c) Heap

d) Tree

202

132. What is the time complexity of finding the maximum element in a binary search
tree?

a) 0(1)

b) O(log n)

c) O(n)

d) O(n lag in)

133. Which of the following sorting algorithms is not an in-place algorithm?


a) Heap Sort

b) Quick Sort

c) Merge Sort

d) Insertion Sort

134. What is the time complexity of finding the maximum flow in a flow network
using the Ford-Fulkerson

algorithm? a) O(m log n)

b) O(n^2)

c) 0(mn)

d) O(fmax*m)

135. Which of the following data structures is used to implement a priority queue?

a) Hash Table

b) AVL Tree

c) Heap

d) Binary Search Tree

136. What is the time complexity of finding the kth smallest element in a binary
search tree?

a) 0(1)

b) O(log n)

c) O(n)

d) O(n log n)

137. Which of the following algorithms is used to perform binary search on sorted
array?

a) Depth-First Search

b) Breadth-First Search

c) Linear Search

d) None of the above

138. Which of the following data structures is used to implement a cache?

a) Queue

b) Stack

c) Heap
d) Hash Table

139. What is the time complexity of inserting a new element into a hash table with
open addressing?

3) 0(1)

b) O(log n)

c) O(n)

d) O(n log n)

140. Which of the following data structures is used to implement Dijkstra's


algorithm for finding the shortest path in a graph?

a) Binary Search Tree

b) AVL Tree

c) Heap

d) Hash Table

141. Which of the following is an example of a non-linear data structure?

a) Array

b) Stack

c) Queue

d) Graph

142. Which of the following algorithms can be used to detect cycles in a graph?

a) Depth-First Search

b) Breadth-First Search

c) Topological Sort

d) All of the above

203

143. Which of the following is not a self-balancing binary search tree?

a) AVL Tree

b) Red-Black Tree

c) Splay Tree

d) B-Tree

144. What is the worst-case time complexity of the heapify operation in a binary
heap?
a) 0(1)

b) O(log n)

c) O(n)

d) O(n log n)

145. Which of the following is an example of an external sorting algorithm?

a) Quick Sort

b) Merge Sort

c) Heap Sort

d) Insertion Sort

146. Which of the following data structures is used to implement a LRU cache?

a) Hash Table

b) Stack

c) Queue

d) Linked List

147.Which of the following algorithms can be used to find the shortest path in a
graph with negative edge weights?

a) Dijkstra's algorithm

b) Bellman-Ford algorithm

c) Floyd-Warshall algorithm

d) A algorithm

148. Which of the following data structures is used to implement a Red-Black Tree?

a) Hash Table

b) Heap

c) AVL Tree

d) None of the above

149. What is the time complexity of the search operation in a skip list?

a) 0(1)

b) O(log n)

c) O(n)

d) O(n log n)
150. Which data structure is used to implement a priority queue?

a) Linked List

b) Hash Table

c) Stack

d) Heap

151. Which of the following sorting algorithms has the highest worst-case time
complexity?

a) Quick Sort

b) Heap Sort

c) Merge Sort

d) Insertion Sort

152. Which of the following data structures is used to implement a symbol table?

a) Linked List

b) Hash Table

c) Heap

d) Stack

153. Which of the following is an example of a dynamic programming algorithm?

a) Dijkstra's algorithm

b) Kruskal's algorithm

c) Floyd-Warshall algorithm

d) Topological Sort

154. Which of the following data structures is used to implement a Trie?

a) Hash Table

b) Heap

204

c) Linked List

d) Tree

155. Which of the following i not a common operation a Binary Search Tree?

a) Insertion

b) Deletion
c) Heapify

d) Searching

156. Which of the following algorithms can be used to find the longest common
subsequence of two strings?

a) Breadth-First Search

b) Depth-First Search

c) Dijkstra's algorithm

d) Dynamic Programming

157. Which of the following data structures is used to implement a Fibonaco Heap?

a) Hash Table

b) AVL Tree

c) Binary Heap

d) None of the above

158. Which of the following is a hash function used in the chaining method of
collision resolution?

a) Division

b) Multiplication

c) XOR

d) All of the above

159. Which of the following algorithms can be used to find the strongly connected
components of a directed graph?

a) Breadth-First Search

b) Depth-First Search

c) Dijkstra's algorithm

d) Prim's algorithm

160. Which of the following data structures is used to implement a LIFO stack?

a) Linked List

b) Array

c) Queue

d) Tree

161. Which of the following sorting algorithms is stable?


a) Quick Sort

b) Selection Sort

c) Heap Sort

d) Merge Sort

162. Which of the following is not a common operation on a Hash Table?

a) Insertion

b) Deletion

c) Searching

d) Heapify

163. Which of the following data structures is used to implement a Queue?

a) Linked List

b) Hash Table

c) Tree

d) Stack

164. Which of the following is not a type of Binary Tree?

a) AVL Tree

b) Red-Black Tree

c) B-Tree

d) Fibonacci Tree

165. Which of the following algorithms can be used to find the shortest path in a
weighted graph?

a) Breadth-First Search

b) Depth-First Search

c) Dijkstra's algorithm

d) Topological Sort

166. Which of the following is not a common application of a Heap?

205

a) Implementing a Priority Queue

b) Sorting

c) Huffman Coding
d) Hashing

167. Which of the following data structures is used to implement a disjoint-set


data structure?

a) Array

b) Hash Table

c) Linked List

d) Tree

168. Which of the following algorithms can be used to find the minimum spanning
tree of a graph?

a) Breadth-First Search

b) Depth-First Search

c) Dijkstra's algorithm

d) Prim's algorithm

169. Which of the following data structures is used to implement a LRU cache?

a) Stack

b) Queue

c) Hash Table

d) Linked List

170.What is the order of traversal in preorder traversal?

a) Root, left subtree, right subtree

b) Left subtree, root, right subtree

c) Right subtree, root, left subtree

d) None of the above

171. What is the order of traversal in postorder traversal?

a) Root, left subtree, right subtree

b) Left subtree, root, right subtree

c) Right subtree, root, left subtree

d) None of the above

172. Which of the following statements is true regarding preorder and postorder
traversal?
a) Preorder traversal is always faster than postorder traversal

b) Postorder traversal is always faster than preorder traversal

c) The time complexity of both preorder and postorder traversal is

O(n)

d) The time complexity of both preorder and postorder traversal is O(log n)

173.Which traversal is used to create a copy of a binary tree?

a) Preorder traversal

b) Postorder traversal

c) Inorder traversal

d) Breadth-first traversal

174. Which traversal is used to evaluate a binary expression tree?

a) Preorder traversal

b) Postorder traversal

c) Inorder traversal

d) Breadth-first traversal

175. What is the time complexity of both preorder and postorder traversal of a
binary tree?

a) O(n)

b) O(log n)

206

c) O(nlogn)

d) O(n^2)

176.In which traversal technique, a node is visited after its subtree?

a) Preorder traversal

b) Postorder traversal

c) Inorder traversal

d) Level-order traversal

177. What is the correct sequence of nodes visited in the following binary tree
during preorder traversal:

A
28

149

a) 5, 2, 1, 4, 8, 9

b) 5, 2, 8, 1, 4, 9

c) 5, 8, 2, 4, 1, 9

d) 5, 2, 1, 8, 4, 9

178. What is the correct sequence of nodes visited in the following binary tree
during postorder traversal:

2 8

149

a) 1, 4, 2, 9, 8,5

b) 1,4,2,9,5,8

c) 4, 1,9,2,8,5

d) 1,4,9,2,8,5

179. Which traversal technique is used to find the height of a binary tree?

a) Preorder traversal

b) Postorder traversal

c) Inorder traversal

d) Level-order traversal

You might also like