wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

DSA_VIVA_3

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

A binary heap is best described as:

a)

A complete binary tree with sorted nodes

b)

A complete binary tree satisfying heap property

c)

A balanced binary search tree

d)

A full binary tree

2.

In a max heap, the value of a parent node is:

a)

Less than its children

b)

Equal to its children

c)

Greater than or equal to its children

d)

Random compared to its children

3.

Which operation takes O(log n) time in a binary heap?

a)

Searching

b)

Insertion

c)

Finding minimum

d)

Traversal

4.

In a trie, each node represents:

a)

A complete word

b)

A character

c)

An integer

d)

A hash value

5.

What is a collision in a hash table?

a)

When a key is deleted

b)

When two keys map to the same index

c)

When the table is full

d)

When searching fails

6.

Which array index represents the left child of index i in a 0-based array heap?

a)

i + 1

b)

2i

c)

2i + 1

d)

2i + 2

7.

In an expression tree, internal nodes represent:

a)

Operands

b)

Constants

c)

Operators

d)

Variables

8.

Which traversal of an expression tree produces infix notation?

a)

Preorder

b)

Inorder

c)

Postorder

d)

Level order

9.

Expression tree evaluation is done using:

a)

Inorder traversal

b)

Preorder traversal

c)

Postorder traversal

d)

Level order traversal

10.

For the expression (A+B)*C, the root node is:

a)

+

b)

A

c)

B

d)

*

11.

The maximum number of nodes in a binary tree of height h is:

a)

b)

2ʰ⁻¹

c)

2ʰ⁺¹ − 1

d)

2ʰ − 1

12.

The number of null pointers in a binary tree with n nodes is:

a)

n

b)

n + 1

c)

2n

d)

n − 1

13.

The maximum number of nodes at level i of a binary tree is:

a)

2ᶦ

b)

2ᶦ⁻¹

c)

d)

2ⁱ⁺¹

14.

Which traversal is used to copy a binary tree?

a)

Inorder

b)

Preorder

c)

Postorder

d)

Level order

15.

In a Binary Search Tree, the left subtree of a node contains:

a)

Values greater than the node

b)

Values smaller than the node

c)

Any values

d)

Only equal values

16.

The average time complexity of searching an element in a BST is:

a)

O(n)

b)

O(log n)

c)

O(n log n)

d)

O(1)

17.

The worst-case time complexity of search in a BST occurs when the tree is:

a)

Balanced

b)

Complete

c)

Skewed

d)

Full

18.

The minimum element in a BST is found by traversing:

a)

Rightmost node

b)

Leftmost node

c)

Root only

d)

Any leaf

19.

Duplicate values in a BST are:

a)

Always allowed

b)

Always disallowed

c)

Allowed based on implementation

d)

Stored only at root

20.

Which case of deletion in BST is most complex?

a)

Leaf node

b)

Node with one child

c)

Node with two children

d)

Root node