NEW
Font size
WorksheetsDSA_VIVA_3
Total questions: 20
Worksheet time: 10mins
A binary heap is best described as:
A complete binary tree with sorted nodes
A complete binary tree satisfying heap property
A balanced binary search tree
A full binary tree
In a max heap, the value of a parent node is:
Less than its children
Equal to its children
Greater than or equal to its children
Random compared to its children
Which operation takes O(log n) time in a binary heap?
Searching
Insertion
Finding minimum
Traversal
In a trie, each node represents:
A complete word
A character
An integer
A hash value
What is a collision in a hash table?
When a key is deleted
When two keys map to the same index
When the table is full
When searching fails
Which array index represents the left child of index i in a 0-based array heap?
i + 1
2i
2i + 1
2i + 2
In an expression tree, internal nodes represent:
Operands
Constants
Operators
Variables
Which traversal of an expression tree produces infix notation?
Preorder
Inorder
Postorder
Level order
Expression tree evaluation is done using:
Inorder traversal
Preorder traversal
Postorder traversal
Level order traversal
For the expression (A+B)*C, the root node is:
+
A
B
*
The maximum number of nodes in a binary tree of height h is:
2ʰ
2ʰ⁻¹
2ʰ⁺¹ − 1
2ʰ − 1
The number of null pointers in a binary tree with n nodes is:
n
n + 1
2n
n − 1
The maximum number of nodes at level i of a binary tree is:
2ᶦ
2ᶦ⁻¹
i²
2ⁱ⁺¹
Which traversal is used to copy a binary tree?
Inorder
Preorder
Postorder
Level order
In a Binary Search Tree, the left subtree of a node contains:
Values greater than the node
Values smaller than the node
Any values
Only equal values
The average time complexity of searching an element in a BST is:
O(n)
O(log n)
O(n log n)
O(1)
The worst-case time complexity of search in a BST occurs when the tree is:
Balanced
Complete
Skewed
Full
The minimum element in a BST is found by traversing:
Rightmost node
Leftmost node
Root only
Any leaf
Duplicate values in a BST are:
Always allowed
Always disallowed
Allowed based on implementation
Stored only at root
Which case of deletion in BST is most complex?
Leaf node
Node with one child
Node with two children
Root node
