76. An undirected graph has 7 edges. The sum of the degrees of all vertices is:
- 49
- 7
- 21
- 14
Answer: D) 14
Explanation: Each edge adds 2 to the total degree. Lesson 3.4 · Data Structures & Algorithms
MCQs / Computer Science / NSCT: Data Structures & Algorithms
150 multiple-choice questions on NSCT: Data Structures & Algorithms from Computer Science, each with the correct answer and, where available, a teacher's explanation. Read through them to revise the chapter, then practise the same questions one by one to test yourself.
Answer: D) 14
Explanation: Each edge adds 2 to the total degree. Lesson 3.4 · Data Structures & Algorithms
Answer: B) 7
Explanation: ⌊log₂ 64⌋ + 1 = 7. Lesson 3.6 · Data Structures & Algorithms
Answer: D) Bellman-Ford
Explanation: Bellman-Ford relaxes all edges V − 1 times. Lesson 3.4 · Data Structures & Algorithms
Answer: D) 25
Explanation: Deleting the maximum leaves the second largest at the root. Lesson 3.3 · Data Structures & Algorithms
Answer: C) Adjacency list
Explanation: It uses O(V + E) space. Lesson 3.4 · Data Structures & Algorithms
Answer: C) Pointers to both next and previous nodes
Explanation: Traversal is possible in both directions. Lesson 3.2 · Data Structures & Algorithms
Answer: D) Number of keys ÷ table size
Explanation: α = n/m. Lesson 3.5 · Data Structures & Algorithms
Answer: D) Divide and conquer
Explanation: Divide the list, sort halves, merge. Lesson 3.6 · Data Structures & Algorithms
Answer: C) 5
Explanation: Final table: [None, 15, 8, None, 11, 12, 27]. Lesson 3.5 · Data Structures & Algorithms
Answer: D) Root
Explanation: Each parent is ≥ its children. Lesson 3.3 · Data Structures & Algorithms
Answer: D) 2
Explanation: Push operands; on an operator pop two values and push the result. Answer 2. Lesson 3.2 · Data Structures & Algorithms
Answer: C) Array
Explanation: A complete binary tree maps neatly to array indices. Lesson 3.3 · Data Structures & Algorithms
Answer: C) 15
Explanation: n(n − 1)/2 = 15. Lesson 3.4 · Data Structures & Algorithms
Answer: C) C
Explanation: Queue after all operations (front→rear): ['C', 'D']. Lesson 3.2 · Data Structures & Algorithms
Answer: C) 15, 10, 8, 12, 20, 25
Explanation: Pre-order visits root, then left subtree, then right subtree. Lesson 3.3 · Data Structures & Algorithms
Answer: D) 11
Explanation: ⌊log₂ 1024⌋ + 1 = 11. Lesson 3.6 · Data Structures & Algorithms
Answer: C) 8, 3, 1, 6, 10, 14
Explanation: Pre-order visits root, then left subtree, then right subtree. Lesson 3.3 · Data Structures & Algorithms
Answer: D) 8, 12, 10, 25, 20, 15
Explanation: Post-order visits left, right, then root – the first key inserted (root) comes last. Lesson 3.3 · Data Structures & Algorithms
Answer: D) Collision
Explanation: Collisions must be resolved. Lesson 3.5 · Data Structures & Algorithms
Answer: C) 7
Explanation: Final table: [None, None, None, 23, 43, 13, None, 27, None, None]. Lesson 3.5 · Data Structures & Algorithms
Answer: B) [1, 5, 4, 2, 8]
Explanation: Selection sort swaps the minimum into position 0. Lesson 3.6 · Data Structures & Algorithms
Answer: B) Primary clustering
Explanation: Runs of filled slots grow and slow down searches. Lesson 3.5 · Data Structures & Algorithms
Answer: B) 40, 60, 70
Explanation: Each step compares with the middle element and keeps one half. Lesson 3.6 · Data Structures & Algorithms
Answer: C) FIFO
Explanation: First in, first out. Lesson 3.2 · Data Structures & Algorithms
Answer: B) O(2ⁿ)
Explanation: Exponential growth overtakes any polynomial. Lesson 3.1 · Data Structures & Algorithms
Practise NSCT: Data Structures & Algorithms MCQs