MauryaHub PYQ Practice

cs4021_2026T1_Q2_NA.pdf

Advanced Algorithms · Quiz 2 · Jan 2026

← Course papers · Start practice / exam

Questions and published explanations below are available without starting a test. Some questions may not have a published solution yet.

Question 2 MCQ · 3.0 marks

Consider the statements about randomized quicksort and answer the given subquestions if they are true or false.
The worst-case running time and expected running time are equal to within constant factors for any randomized algorithm.
  1. True
  2. False

A published solution is not available for this question yet.

Question 3 MCQ · 3.0 marks

Consider the statements about randomized quicksort and answer the given subquestions if they are true or false.
An adversary can provide randomized quicksort with an input array of length [[IMAGE:753fc3671e35dbfc_2_2]] that forces the algorithm to run in [[IMAGE:753fc3671e35dbfc_2_3]] time on that input. (If you are not familiar with the [[IMAGE:753fc3671e35dbfc_2_4]] asymptotic notation, it roughly translates as “at least”. For example, we can say that it is possible to come up with an input that forces insertion sort to run for [[IMAGE:753fc3671e35dbfc_2_5]] steps.)
Source diagram or notationSource diagram or notationSource diagram or notationSource diagram or notation
  1. True
  2. False

A published solution is not available for this question yet.

Question 4 MCQ · 3.0 marks

In RANDOMIZED-QUICKSORT, consider two distinct elements [[IMAGE:753fc3671e35dbfc_3_6]] and [[IMAGE:753fc3671e35dbfc_3_7]] with [[IMAGE:753fc3671e35dbfc_3_8]] . What is the probability that these two elements are compared during execution?
Source diagram or notationSource diagram or notationSource diagram or notation
  1. [[IMAGE:753fc3671e35dbfc_3_9]]
    Source diagram or notation
  2. [[IMAGE:753fc3671e35dbfc_3_10]]
    Source diagram or notation
  3. [[IMAGE:753fc3671e35dbfc_3_11]]
    Source diagram or notation
  4. [[IMAGE:753fc3671e35dbfc_3_12]]
    Source diagram or notation

A published solution is not available for this question yet.

Question 5 MCQ · 3.0 marks

**Generating UAR Sequences** The goal of this exercise is to compute a uniformly random permutation of [[IMAGE:753fc3671e35dbfc_3_13]] . Assume we have a generator that produces independent uniform real numbers in [[IMAGE:753fc3671e35dbfc_3_14]] . Consider the following algorithm: • Generate random numbers [[IMAGE:753fc3671e35dbfc_3_15]] independently from [[IMAGE:753fc3671e35dbfc_3_16]] • Pair them as [[IMAGE:753fc3671e35dbfc_3_17]] • Sort the pairs in **decreasing order** of [[IMAGE:753fc3671e35dbfc_3_18]] • Output the permutation based on sorted indices Does this procedure generate a uniformly random permutation of [[IMAGE:753fc3671e35dbfc_3_19]] ?
Source diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notation
  1. Yes
  2. No

A published solution is not available for this question yet.

Question 6 MCQ · 3.0 marks

Consider the following approximation algorithm for the weighted vertex cover problem: 1. Solve the relaxed linear program corresponding to the given problem: **Minimize** [[IMAGE:753fc3671e35dbfc_4_20]] **Subject to** [[IMAGE:753fc3671e35dbfc_4_21]] 2. [[IMAGE:753fc3671e35dbfc_4_22]] 3. return [[IMAGE:753fc3671e35dbfc_4_23]] Based on the above data, answer the given subquestions.
Suppose that instead of putting a vertex [[IMAGE:753fc3671e35dbfc_4_24]] into the cover when [[IMAGE:753fc3671e35dbfc_4_25]] , we put [[IMAGE:753fc3671e35dbfc_4_26]] into the cover when [[IMAGE:753fc3671e35dbfc_4_27]] . What happens?
Source diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notation
  1. We still get a valid solution, and the algorithm remains a 2-approximation.
  2. We still get a valid solution, and the algorithm becomes a 4-approximation.
  3. We may no longer get a valid solution.

A published solution is not available for this question yet.

Question 7 MCQ · 3.0 marks

Consider the following approximation algorithm for the weighted vertex cover problem: 1. Solve the relaxed linear program corresponding to the given problem: **Minimize** [[IMAGE:753fc3671e35dbfc_4_20]] **Subject to** [[IMAGE:753fc3671e35dbfc_4_21]] 2. [[IMAGE:753fc3671e35dbfc_4_22]] 3. return [[IMAGE:753fc3671e35dbfc_4_23]] Based on the above data, answer the given subquestions.
Suppose that instead of putting a vertex [[IMAGE:753fc3671e35dbfc_5_28]] into the cover when [[IMAGE:753fc3671e35dbfc_5_29]] , we put [[IMAGE:753fc3671e35dbfc_5_30]] into the cover when [[IMAGE:753fc3671e35dbfc_5_31]] . What happens?
Source diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notation
  1. We still get a valid solution, and the algorithm remains a 2-approximation.
  2. We still get a valid solution, and the algorithm becomes a [[IMAGE:753fc3671e35dbfc_5_32]] -approximation.
    Source diagram or notation
  3. We may no longer get a valid solution.

A published solution is not available for this question yet.

Question 8 MCQ · 3.0 marks

Consider the following approximation algorithm for the weighted vertex cover problem: 1. Solve the relaxed linear program corresponding to the given problem: **Minimize** [[IMAGE:753fc3671e35dbfc_4_20]] **Subject to** [[IMAGE:753fc3671e35dbfc_4_21]] 2. [[IMAGE:753fc3671e35dbfc_4_22]] 3. return [[IMAGE:753fc3671e35dbfc_4_23]] Based on the above data, answer the given subquestions.
Suppose that we modify the algorithm to include vertex [[IMAGE:753fc3671e35dbfc_5_33]] in the cover only when [[IMAGE:753fc3671e35dbfc_5_34]] . What happens?
Source diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notation
  1. We still get a valid solution, and the algorithm remains a 2-approximation.
  2. We may no longer get a valid solution.
  3. We get an optimal solution always.

A published solution is not available for this question yet.

Question 9 MCQ · 3.0 marks

Consider the following approximation algorithm for the weighted vertex cover problem: 1. Solve the relaxed linear program corresponding to the given problem: **Minimize** [[IMAGE:753fc3671e35dbfc_4_20]] **Subject to** [[IMAGE:753fc3671e35dbfc_4_21]] 2. [[IMAGE:753fc3671e35dbfc_4_22]] 3. return [[IMAGE:753fc3671e35dbfc_4_23]] Based on the above data, answer the given subquestions.
Suppose that we include vertex [[IMAGE:753fc3671e35dbfc_5_35]] in the cover when [[IMAGE:753fc3671e35dbfc_5_36]] . What happens?
Source diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notation
  1. We always get a valid solution, but the approximation factor may become worse.
  2. We always get an optimal solution.
  3. We may not get a valid solution.

A published solution is not available for this question yet.

Question 10 MCQ · 2.0 marks

[[IMAGE:753fc3671e35dbfc_6_37]] Based on the above data, answer the given subquestions.
A graph G is a cluster graph if and only if it does not have an induced path on 3 vertices.
Source diagram or notation
  1. True
  2. False

A published solution is not available for this question yet.

Question 11 MCQ · 2.0 marks

[[IMAGE:753fc3671e35dbfc_6_37]] Based on the above data, answer the given subquestions.
In the DISJOINT CLUSTER VERTEX DELETION problem, if the subgraph induced on S is not a cluster graph, we can immediately return YES.
Source diagram or notation
  1. True
  2. False

A published solution is not available for this question yet.

Question 12 MCQ · 2.0 marks

[[IMAGE:753fc3671e35dbfc_6_37]] Based on the above data, answer the given subquestions.
In the DISJOINT CLUSTER VERTEX DELETION problem, if the subgraph induced on the vertices of S is not a cluster graph, we can immediately return NO.
Source diagram or notation
  1. True
  2. False

A published solution is not available for this question yet.

Question 13 MCQ · 2.0 marks

[[IMAGE:753fc3671e35dbfc_6_37]] Based on the above data, answer the given subquestions.
If the subgraph induced on the vertices of S is a cluster graph and a vertex in V (G) \ S is adjacent to at least two vertices in S which are in different cliques, then we can delete it and leave the parameter unchanged.
Source diagram or notation
  1. True
  2. False

A published solution is not available for this question yet.

Question 14 MCQ · 2.0 marks

[[IMAGE:753fc3671e35dbfc_6_37]] Based on the above data, answer the given subquestions.
If the subgraph induced on the vertices of S is a cluster graph and a vertex in V (G) \ S is adjacent to at least two vertices in S which are in different cliques, then we can delete it and decrease the parameter by 1.
Source diagram or notation
  1. True
  2. False

A published solution is not available for this question yet.

Question 15 MCQ · 2.0 marks

[[IMAGE:753fc3671e35dbfc_6_37]] Based on the above data, answer the given subquestions.
If the subgraph induced on the vertices of S is a cluster graph and a vertex in V (G) \ S is adjacent to some but not all vertices in a clique of G[S], then we can delete it and leave the parameter unchanged.
Source diagram or notation
  1. True
  2. False

A published solution is not available for this question yet.

Question 16 MCQ · 2.0 marks

[[IMAGE:753fc3671e35dbfc_6_37]] Based on the above data, answer the given subquestions.
If the subgraph induced on the vertices of S is a cluster graph and a vertex in V (G) \ S is adjacent to some but not all vertices in a clique of G[S], then we can delete it and decrease the parameter by 1.
Source diagram or notation
  1. True
  2. False

A published solution is not available for this question yet.

Question 17 MSQ · 2.0 marks

Consider a graph [[IMAGE:753fc3671e35dbfc_8_38]] and let [[IMAGE:753fc3671e35dbfc_8_39]] denote its chromatic number. Let [[IMAGE:753fc3671e35dbfc_8_40]] . Select all true statements:
Source diagram or notationSource diagram or notationSource diagram or notation
  1. If [[IMAGE:753fc3671e35dbfc_8_41]] is an **independent set**, then [[IMAGE:753fc3671e35dbfc_8_42]]
    Source diagram or notationSource diagram or notation
  2. There exists an optimal coloring of [[IMAGE:753fc3671e35dbfc_8_43]] such that **every color class is a** **maximal independent set**.
    Source diagram or notation
  3. If [[IMAGE:753fc3671e35dbfc_8_44]] is a **maximum independent set**, then [[IMAGE:753fc3671e35dbfc_8_45]]
    Source diagram or notationSource diagram or notation
  4. A DP over subsets that tries all independent sets leads to an algorithm running in [[IMAGE:753fc3671e35dbfc_8_46]] time.
    Source diagram or notation

A published solution is not available for this question yet.

Question 18 MSQ · 2.0 marks

Let [[IMAGE:753fc3671e35dbfc_8_47]] be a maximal independent set in graph [[IMAGE:753fc3671e35dbfc_8_48]] . Select all true statements:
Source diagram or notationSource diagram or notation
  1. For every vertex [[IMAGE:753fc3671e35dbfc_8_49]] , **all neighbours** of [[IMAGE:753fc3671e35dbfc_8_50]] must be in [[IMAGE:753fc3671e35dbfc_8_51]]
    Source diagram or notationSource diagram or notationSource diagram or notation
  2. In branching algorithms, we can branch on a vertex [[IMAGE:753fc3671e35dbfc_8_52]] by either: • include [[IMAGE:753fc3671e35dbfc_8_53]] , or • exclude [[IMAGE:753fc3671e35dbfc_8_54]] and include all neighbours of [[IMAGE:753fc3671e35dbfc_8_55]]
    Source diagram or notationSource diagram or notationSource diagram or notationSource diagram or notation
  3. If a vertex has degree 0, it must be included in every maximum independent set
  4. If [[IMAGE:753fc3671e35dbfc_9_56]] , then removing [[IMAGE:753fc3671e35dbfc_9_57]] does not reduce the size of maximum independent set
    Source diagram or notationSource diagram or notation

A published solution is not available for this question yet.

Question 19 MCQ · 2.0 marks

[[IMAGE:753fc3671e35dbfc_9_58]] In the above figure, we have a graph G and a **Feedback Vertex Set (FVS)** of size 3, which is given by the boxed vertices: S := {a, c, e} We need to find a **DISJOINT FVS** of size 2. For each of the given statements, determine whether it is **True** or **False**. Based on the above data, answer the given subquestions.
According to the reduction rules for **DFVS**, the following figure shows a valid intermediate instance in the reduction with [[IMAGE:753fc3671e35dbfc_9_59]] . [[IMAGE:753fc3671e35dbfc_10_60]]
Source diagram or notationSource diagram or notationSource diagram or notation
  1. True
  2. False

A published solution is not available for this question yet.

Question 20 MCQ · 2.0 marks

[[IMAGE:753fc3671e35dbfc_9_58]] In the above figure, we have a graph G and a **Feedback Vertex Set (FVS)** of size 3, which is given by the boxed vertices: S := {a, c, e} We need to find a **DISJOINT FVS** of size 2. For each of the given statements, determine whether it is **True** or **False**. Based on the above data, answer the given subquestions.
According to the reduction rules for **DFVS**, the following figure shows a valid intermediate instance in the reduction with [[IMAGE:753fc3671e35dbfc_10_61]] . [[IMAGE:753fc3671e35dbfc_10_62]]
Source diagram or notationSource diagram or notationSource diagram or notation
  1. True
  2. False

A published solution is not available for this question yet.

Question 21 MCQ · 2.0 marks

[[IMAGE:753fc3671e35dbfc_9_58]] In the above figure, we have a graph G and a **Feedback Vertex Set (FVS)** of size 3, which is given by the boxed vertices: S := {a, c, e} We need to find a **DISJOINT FVS** of size 2. For each of the given statements, determine whether it is **True** or **False**. Based on the above data, answer the given subquestions.
According to the reduction rules for **DFVS**, the following figure shows a valid intermediate instance in the reduction with [[IMAGE:753fc3671e35dbfc_10_63]] . [[IMAGE:753fc3671e35dbfc_10_64]]
Source diagram or notationSource diagram or notationSource diagram or notation
  1. True
  2. False

A published solution is not available for this question yet.

Question 22 MCQ · 2.0 marks

[[IMAGE:753fc3671e35dbfc_9_58]] In the above figure, we have a graph G and a **Feedback Vertex Set (FVS)** of size 3, which is given by the boxed vertices: S := {a, c, e} We need to find a **DISJOINT FVS** of size 2. For each of the given statements, determine whether it is **True** or **False**. Based on the above data, answer the given subquestions.
According to the reduction rules for **DFVS**, the following figure shows a valid intermediate instance in the reduction with [[IMAGE:753fc3671e35dbfc_11_65]] . [[IMAGE:753fc3671e35dbfc_11_66]]
Source diagram or notationSource diagram or notationSource diagram or notation
  1. True
  2. False

A published solution is not available for this question yet.