Explore topic-wise MCQs in Data Structures and Algorithms.

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

51.

Do ternary heap have better memory cache behavior than binary heap.

A. True
B. False
Answer» B. False
52.

The procedure FindMin() to find the minimum element and the procedure DeleteMin() to delete the minimum element in min heap take _________

A. logarithmic and linear time constant respectively
B. constant and linear time respectively
C. constant and quadratic time respectively
D. constant and logarithmic time respectively
Answer» E.
53.

How many comparisons will occur while performing a delete-min operation?

A. d
B. d-1
C. d+1
D. 1
Answer» C. d+1
54.

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.
55.

How many types of the merge are available in skew heaps?

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

Should leaves in ternary heap be distributed from left to right.

A. True
B. False
Answer» B. False
57.

Is the priority queue abstract data type.

A. True
B. False
Answer» B. False
58.

What is the node path length of a node with 0 or 1 child?

A. 1
B. -1
C. 0
Answer» D.
59.

Pairing heaps time complexity was inspired by that of?

A. splay tree
B. treap
C. red-black tree
D. avl tree
Answer» B. treap
60.

What is the time per operation of merging, insertion and deletion operations in a skew heap?

A. O(N)
B. O(log N)
C. O(N log N)
D. O(N2)
Answer» C. O(N log N)
61.

___________ is a self-adjusting version of a leftist heap.

A. Rightist heap
B. Skew heap
C. d-heap
D. Binary heap
Answer» C. d-heap
62.

Why would a recursive implementation fail in skew heaps?

A. skew heaps are self adjusting
B. efficiency gets reduced
C. lack of stack space
D. time complexity
Answer» D. time complexity
63.

Which of the following is difficult to determine the right path length?

A. Skew heaps
B. Binomial tree
C. Leftist heap
D. d-heap
Answer» B. Binomial tree
64.

What is the time complexity for decreasing priority of key in a maximum ternary heap of n elements?

A. O (log n/ log 3)
B. O (3log n/ log 3)
C. O (n)
D. O (1)
Answer» C. O (n)
65.

What is the time taken to delete a minimum element in a leftist heap?

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

The relationship of skew heaps to leftist heaps is analogous to that of?

A. Splay tree and AVL tree
B. Red black tree and AVL tree
C. Binary tree and Splay tree
D. Binary tree and Red black tree
Answer» B. Red black tree and AVL tree
67.

In a leftist heap, all the operations should be performed on?

A. left path
B. centre path
C. right path
D. root
Answer» D. root
68.

How many nodes does a leftist tree with r nodes must have?

A. 2r
B. 2r-1
C. 2r
D. 2r-1
Answer» C. 2r
69.

The worst case running time of all operations in a skew heap is given as?

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

Which type of data structure is a ternary heap?

A. Array
B. Hash
C. Priority Queue
D. Priority Stack
Answer» D. Priority Stack
71.

What is the run time efficiency of an insertion algorithm?

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

Which of the following operations does not destroy the leftist heap property?

A. insert
B. merge
C. delete
D. swap
Answer» D. swap
73.

Which of the following is the application of minimum ternary heap?

A. Prim's Algorithm
B. Euclid's Algorithm
C. Eight Queen Puzzle
D. Tree
Answer» B. Euclid's Algorithm
74.

What is the amortized cost per operation of a skew heap?

A. O(N)
B. O(N log N)
C. O(N2)
D. O(log N)
Answer» E.
75.

The roots of the elements of the subtrees are smaller than the root of the heap.

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

What is the time complexity for increasing priority of key in a maximum ternary heap of n elements?

A. O (log n/ log 3)
B. O (n!)
C. O (n)
D. O (1)
Answer» B. O (n!)
77.

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. None of the mentioned
Answer» D. None of the mentioned
78.

Which of the following methods is the best choice for complex applications?

A. binary heap
B. d-heap
C. treap
D. pairing heap
Answer» E.
79.

Which property should ternary heap hold for execution?

A. Associative
B. Commutative
C. Tree
D. Heap
Answer» E.
80.

Descending priority queue can be implemented using ______

A. max heap
B. min heap
C. min-max heap
D. trie
Answer» B. min heap
81.

What is the run time efficiency of an insertion algorithm in d-heap?

A. O(N)
B. O(log N)
C. O(logd N)
D. O(Nd)
Answer» D. O(Nd)
82.

What is the time complexity for creating a ternary heap using swapping?

A. O (log n/ log 3)
B. O (n!)
C. O (n)
D. O (1)
Answer» D. O (1)
83.

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 o?

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

Heap can be used as ________________

A. Priority queue
B. Stack
C. A decreasing order array
D. None of the mentioned
Answer» B. Stack
85.

The worst case complexity of deleting any arbitrary node value element from heap is

A. O(logn)
B. O(n)
C. O(nlogn)
D. O(n<sup>2</sup>)
Answer» B. O(n)
86.

What is the complexity of adding an element to the heap.

A. O(log n)
B. O(h)
C. O(log n) & O(h)
D. None of the mentioned
Answer» D. None of the mentioned
87.

Heap exhibits the property of a binary tree?

A. True
B. False
Answer» B. False
88.

In a max-heap, element with the greatest key is always in the which node?

A. Leaf node
B. First node of left sub tree
C. root node
D. First node of right sub tree
Answer» D. First node of right sub tree