VU Quiz 3

CS301 Data Structures Quiz 3 2024

MCQ 1:

In an array representation of a complete binary tree, if a node is at index i, its right child is at index:

a. i + 1 b. 2i c. 2i – 1 d. 2i + 1

MCQ 2:

An expression tree is evaluated in which of the following manners?

a. Top Down b. Bottom Up c. Left to Right d. Right to Left

MCQ 3:

In an array representation of a complete binary tree, the children of the node with value 15 are located at indices (assuming indexing starts at 1):

a. 7, 8 b. 15, 30 c. 13, 2 d. 6, 7

MCQ 4:

In a strictly complete binary tree, the number of nodes at level ‘k’ is:

a. k^2 b. 2k c. k d. 2^k

MCQ 5:

A binary tree with ‘N’ internal nodes has the following number of links to internal and external nodes respectively:

a. N, N b. N-1, N-1 c. 2N, N-1, N+1 d. 2N, N, N

MCQ 6:

The stage in a compiler where common sub-expressions are recognized and eliminated to improve code efficiency is called:

a. Pre-processing b. Linking c. Intermediate Code Generation d. Optimization

MCQ 7:

In an expression tree, a node representing a unary operator will have how many subtrees?

a. One b. Two c. Three d. Zero

MCQ 8:

In a Huffman tree, which value is assigned to the left branch?

a. 0 b. 1 c. The frequency of the node d. The character represented by the node

MCQ 9:

In a threaded binary tree, how many nodes have NULL child pointers?

a. All leaf nodes b. Only the root node c. Half of the nodes d. None of the nodes

MCQ 10:

a. Red-Black Tree b. Splay Tree c. AVL Tree d. B-Tree

MCQ 11:

Which of the following data structures is uses d to implement recursion

a. Queue b. Stack c. Linked List d. Binary Tree

MCQ 12:

What is the time complexity of inserting an element at the beginning of a singly linked list?

a. O(1) b. O(n) c. O(log n) d. O(n^2)

MCQ 13:

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. Selection Sort

MCQ 14:

In a binary search tree, what is the maximum number of children a node can have?

a. 1 b. 2 c. 3 d. 4

MCQ 15:

What is the purpose of a hash function in a hash table?

a. To sort data b. To search data c. To map keys to array indices d. To manage memory

True/False Questions

MCQ 16:

A queue follows the FIFO (First In, First Out) principle.

a. True b. False

MCQ 17:

A binary tree is a special type of tree where each node has at most two children.

a. True b. False

MCQ 18:

A graph with no cycles is called a cyclic graph.

a. True b. False

MCQ 19:

a. True b. False

MCQ 20:

Depth-first search (DFS) and breadth-first search (BFS) are both used to traverse graphs.

a. True b. False

MCQ 21:

Which of the following operations is not performed by a stack?

a. Push b. Pop c. Peek d. Enqueue

MCQ 22:

Which data structure is used in implementing recursion?

a. Queue b. Stack c. Tree d. Graph

MCQ 23:

What is the best-case time complexity of bubble sort?

a. O(n) b. O(n log n) c. O(n^2) d. O(log n)

MCQ 24:

In a circular linked list, the last node points to which node?

a. The first node b. Itself c. A null value d. The node in the middle

Leave a Reply

Your email address will not be published. Required fields are marked *