Independent Preparation Bank for Pakistani Computing Graduates • 100% Free • No Signup
NSCTTest.
Simulator
Data Structures & AlgorithmsTopic #5 of 540 MCQs Available

Graph Algorithms

Comprehensive question bank, step-by-step rationales, and dedicated timed quiz for Graph Algorithms.

Launch Quiz Mode ↗

Graph Algorithms Question Bank

Showing 40 questions of 40 with verified answers

24Multiple Choice

(Conceptual) In a graph, what is an "Articulation Point"?

25Multiple Choice

(Conceptual) Which problem is classified as NP-Complete in graph theory?

1Multiple Choice

(Conceptual) Which algorithm design technique is characterized by making the "best" immediate choice at every stage without reconsidering previous decisions?

2Multiple Choice

(Scenario-Based) You are solving the 0/1 Knapsack Problem (where items cannot be divided). Which technique is required to find the absolute maximum value?

3Multiple Choice

(Conceptual) In Dynamic Programming, what is Memoization?

4Multiple Choice

(Code-Tracing / Logic) Trace the logic of Binary Search. Which design paradigm does it follow?

5Multiple Choice

(Conceptual) What is the main characteristic of Backtracking?

6Multiple Choice

(Scenario-Based) A change-making algorithm always picks the largest coin denomination first. For standard US currency (25, 10, 5, 1), this works. For custom coins (10, 7, 1), it fails to find the minimum number of coins for the value 14. This shows the failure of:

7Multiple Choice

(Calculation) If a recursive Fibonacci function F(n) = F(n-1) + F(n-2) is implemented without DP, what is its time complexity?

8Multiple Choice

(Conceptual) What is Overlapping Sub-problems in the context of DP?

9Multiple Choice

(Comparison) What is the difference between Memoization and Tabulation?

10Multiple Choice

(Scenario-Based) You need to find all possible permutations of a string. Which technique is most appropriate?

11Multiple Choice

(Conceptual) Which algorithm design technique is used in Prim's and Kruskal's algorithms for finding a Minimum Spanning Tree?

12Multiple Choice

(Calculation) In the Master Theorem T(n) = aT(n/b) + f(n), what does the variable a represent?

13Multiple Choice

(Conceptual) What is Optimal Substructure?

14Multiple Choice

(Scenario-Based) A program calculates the "Longest Common Subsequence" between two DNA strands. It uses a 2D table to store scores. This is an example of:

15Multiple Choice

(Conceptual) Which technique is best for solving the Traveling Salesperson Problem (TSP) to find the absolute shortest path (ignoring time complexity)?

16Multiple Choice

(Code-Tracing) Trace the complexity of Strassen's Matrix Multiplication. It is faster than the standard O(N³) method. Which paradigm does it use?

17Multiple Choice

(Conceptual) What is State Space Search?

18Multiple Choice

(Calculation) If a DP table for a problem has dimensions N \times W, what is the *Space Complexity** of the algorithm?

19Multiple Choice

(Conceptual) Why is Merge Sort considered a "Pure" Divide and Conquer algorithm compared to Quick Sort?

20Multiple Choice

(Scenario-Based) You need to find the "Huffman Encoding" for a set of characters based on their frequency. Which technique is used?

21Multiple Choice

(Conceptual) What is the "Top-Down" approach in Algorithm Design?

22Multiple Choice

(Conceptual) Which of the following is an example of an **NP-Complete** problem that is often solved using Backtracking?

23Multiple Choice

(Code-Tracing) What happens to the **Time Complexity** of a recursive algorithm when we add **Memoization**?

24Multiple Choice

(Scenario-Based) An algorithm is using Divide and Conquer to find the closest pair of points in a 2D plane. What is the standard complexity achieved?

25Multiple Choice

(Conceptual) What is the difference between Backtracking and Brute Force?

1Multiple Choice

(Conceptual) In a Binary Min-Heap, where is the second smallest element located?

2Multiple Choice

(Scenario-Based) You are building a search engine "Auto-complete" feature. Which data structure provides the most efficient way to store words and find all words starting with a specific prefix?

3Multiple Choice

(Conceptual) In the Disjoint Set Union (DSU) data structure, what is the specific purpose of "Path Compression"?

4Multiple Choice

(Code-Tracing / Calculation) If a Binary Heap is stored in a 0-indexed array, what is the index of the Right Child of the element at index i?

5Multiple Choice

(Conceptual) What is the time complexity of the Extract-Min operation in a Min- Heap with N elements?

6Multiple Choice

(Scenario-Based) A developer needs to perform 1,000,000 "Range Minimum Queries" (finding the smallest number between index i and j) on an array that is frequently updated. Which structure is best?

7Multiple Choice

(Conceptual) In a **Trie**, how do we represent the end of a word if one word is a prefix of another (e.g., "fast" and "faster")?

8Multiple Choice

(Comparison) What is a major memory-related disadvantage of a Trie compared to a Hash Map for string storage?

9Multiple Choice

(Calculation) What is the time complexity to build a Binary Heap from an unsorted array of N elements using the bottom-up heapify method?

10Multiple Choice

(Scenario-Based) You are implementing **Kruskal’s Algorithm** to find a Minimum Spanning Tree. Which data structure is essential to efficiently detect if adding an edge will form a cycle?

11Multiple Choice

(Conceptual) In DSU, what is the purpose of **"Union by Rank"** (or Size)?

12Multiple Choice

(Calculation) In a Max-Heap stored in an array, what is the index of the Parent of a node at index 7 (assuming 0-indexed)?

27Multiple Choice

Which algorithm is capable of computing single-source shortest paths in a directed graph containing negative edge weights without negative cycles?