Explore topic-wise MCQs in Data Structures and Algorithms.

This section includes 9 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.

The leaf node for a heap of height h will be at which position.

A. h
B. h-1
C. h or h-1
D. h-2
Answer» D. h-2
2.

Does there exist a heap with seven distinct elements so that the Inorder traversal gives the element in sorted order.

A. Yes
B. No
Answer» C.
3.

What is the complexity of given function of insertion.

A. O(logn)
B. amortized O(1)
C. O(n)
D. O (n*logn)View Answer
Answer» C. O(n)
4.

O(logn)

A. amortized O(1)
B. O(n)
C. None of the mentioned
Answer» C. None of the mentioned
5.

The total comparisons in finding both smallest and largest elements are

A. 2*n +2
B. n + ((n+1)/2) -2
C. n+logn
D. n<sup>2</sup>
Answer» C. n+logn
6.

What is the worst case time in searching minimum value in weak -heap?

A. O(log n)
B. O(n)
C. O(n logn)
D. O(1)
Answer» E.
7.

What is the other name of weak heap?

A. Min-heap
B. Max-heap
C. Relaxed -heap
D. Leonardo heap
Answer» D. Leonardo heap
8.

Left child of parent node has value lesser than the parent node.

A. True
B. False
Answer» C.
9.

Choose the correct properties of weak-heap.

A. Every node has value greater than the value of child node
B. Every right child of node has greater value than parent node
C. Every left child of node has greater value than parent node
D. None of the mentioned
Answer» C. Every left child of node has greater value than parent node