MauryaHub PYQ Practice

Advanced Algorithms · Quiz 1 · May 2024

Advanced Algorithms · Quiz 1 · May 2024

← 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.

0 / 26 published solutions

Question 183 NAT · 2.0 marks

Source diagram or notation
Based on the above data answer the given subquestions.
What is the answer if the input is 1 1 2 1?

A published solution is not available for this question yet.

Report a correction for Q183

Question 184 NAT · 2.0 marks

Source diagram or notation
Based on the above data answer the given subquestions.
What is the answer if the input is 1 2 3 4 5 6 7 8 9 10?

A published solution is not available for this question yet.

Report a correction for Q184

Question 185 NAT · 2.0 marks

Source diagram or notation
Based on the above data answer the given subquestions.
What is the answer if 2n = 50 and the input is the set of all even numbers between 1 and 100? (Hint: you might want to use the fact that the sum of the first n odd numbers is n\(^{2}\).)

A published solution is not available for this question yet.

Report a correction for Q185

Question 186 MSQ · 2.0 marks

Source diagram or notation
Based on the above data answer the given subquestions.
What is the general strategy for solving this problem? Select all strategies that are correct.
6406532786849.
Pick the two smallest available numbers in every step.
6406532786850.
Pair the smallest and largest numbers in every step.
6406532786851.
Pair the smallest number with the median element in every step.
6406532786852.
Pair the largest number with the median element in every step.
6406532786853.
Pick the two largest available numbers in every step.

A published solution is not available for this question yet.

Report a correction for Q186

Question 187 MCQ · 2.0 marks

Source diagram or notation
To play optimally means to play to force a win whenever possible. Based on the above data answer the given subquestions.
Source diagram or notation
6406532786854.
Alice
6406532786855.
Bob
6406532786856.
Draw

A published solution is not available for this question yet.

Report a correction for Q187

Question 188 MCQ · 2.0 marks

Source diagram or notation
To play optimally means to play to force a win whenever possible. Based on the above data answer the given subquestions.
Source diagram or notation
6406532786857.
Alice
6406532786858.
Bob
6406532786859.
Draw

A published solution is not available for this question yet.

Report a correction for Q188

Question 189 MCQ · 2.0 marks

Source diagram or notation
To play optimally means to play to force a win whenever possible. Based on the above data answer the given subquestions.
Source diagram or notation
6406532786860.
Alice
6406532786861.
Bob
6406532786862.
Draw

A published solution is not available for this question yet.

Report a correction for Q189

Question 190 MCQ · 2.0 marks

Source diagram or notation
To play optimally means to play to force a win whenever possible. Based on the above data answer the given subquestions.
Source diagram or notation
6406532786863.
Alice
6406532786864.
Bob
6406532786865.
Draw

A published solution is not available for this question yet.

Report a correction for Q190

Question 191 MCQ · 2.0 marks

Source diagram or notation
To play optimally means to play to force a win whenever possible. Based on the above data answer the given subquestions.
Source diagram or notation
6406532786866.
Alice
6406532786867.
Bob
6406532786868.
Draw

A published solution is not available for this question yet.

Report a correction for Q191

Question 192 MCQ · 2.0 marks

Source diagram or notation
To play optimally means to play to force a win whenever possible. Based on the above data answer the given subquestions.
What is the general strategy for Alice?
6406532786869.
Pick the largest even number available.
6406532786870.
Pick the largest odd number available.
6406532786871.
Pick the largest number available.
6406532786872.
Pick the smallest even number available.
6406532786873.
Pick the smallest odd number available.
6406532786874.
Pick the smallest number available.

A published solution is not available for this question yet.

Report a correction for Q192

Question 193 MCQ · 1.0 marks

Source diagram or notation
Based on the above data answer the given subquestions.
Source diagram or notation
6406532786875.
TRUE
6406532786876.
FALSE

A published solution is not available for this question yet.

Report a correction for Q193

Question 194 MCQ · 2.0 marks

Source diagram or notation
Based on the above data answer the given subquestions.
Source diagram or notation
6406532786877.
TRUE
6406532786878.
FALSE

A published solution is not available for this question yet.

Report a correction for Q194

Question 195 MCQ · 2.0 marks

Source diagram or notation
Based on the above data answer the given subquestions.
Source diagram or notation
6406532786879.
TRUE
6406532786880.
FALSE

A published solution is not available for this question yet.

Report a correction for Q195

Question 196 NAT · 2.0 marks

Source diagram or notation
Based on the above data answer the given subquestions.
What is the answer if there are four flowers with heights 3, 1, 4, 2 and beauties 10, 20, 30, 40, respectively?

A published solution is not available for this question yet.

Report a correction for Q196

Question 197 NAT · 2.0 marks

Source diagram or notation
Based on the above data answer the given subquestions.
What is the answer if there are four flowers with heights 4, 3, 2, 1 and beauties 10, 20, 30, 40, respectively?

A published solution is not available for this question yet.

Report a correction for Q197

Question 198 NAT · 3.0 marks

Source diagram or notation
Based on the above data answer the given subquestions.
What is the answer if there are nine flowers with heights 4, 2, 5, 8, 3, 6, 1, 7, 9 and beauties 6, 8, 8, 4, 6, 3, 5, 7, 5, respectively?

A published solution is not available for this question yet.

Report a correction for Q198

Question 199 MCQ · 2.0 marks

Source diagram or notation
Based on the above data answer the given subquestions.
Consider the following greedy algorithm for the problem: scan the flowers left to right. If the current flower violates the monotonicity condition with respect to the sequence we have so far, remove it. Otherwise, keep it. Is this algorithm correct?
6406532786884.
Yes
6406532786885.
No

A published solution is not available for this question yet.

Report a correction for Q199

Question 200 MCQ · 2.0 marks

Source diagram or notation
Based on the above data answer the given subquestions.
Consider the following greedy algorithm for the problem: Phase 1. scan the flowers left to right. If the current flower violates the monotonicity condition (increasing heights) with respect to the sequence we have so far, remove it. Otherwise, keep it. At the end, suppose the total beauty of the remaining flowers is p. Phase 2. Starting with the original set of flowers again, scan them right to left. If the current flower violates the monotonicity condition (decreasing heights) with respect to the sequence we have so far, remove it. Otherwise, keep it. At the end, suppose the total beauty of the remaining flowers is q. Return max(p, q). Is this algorithm correct?
6406532786886.
Yes
6406532786887.
No

A published solution is not available for this question yet.

Report a correction for Q200

Question 201 MCQ · 2.0 marks

Source diagram or notation
Based on the above data answer the given subquestions.
Consider the following greedy algorithm for the problem. Initially, all flowers are unmarked. Repeat until a monotonically increasing sequence is obtained: keep and mark the most beautiful unmarked flower, and remove all flowers taller than it to its left and shorter than it to its right. Is this algorithm correct?
6406532786888.
Yes
6406532786889.
No

A published solution is not available for this question yet.

Report a correction for Q201

Question 202 MCQ · 1.0 marks

Source diagram or notation
Based on the above data answer the given subquestions.
Source diagram or notation
6406532786890.Source diagram or notation
6406532786891.Source diagram or notation
6406532786892.Source diagram or notation
6406532786893.Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q202

Question 203 MCQ · 1.0 marks

Source diagram or notation
Based on the above data answer the given subquestions.
Source diagram or notation
6406532786894.Source diagram or notation
6406532786895.Source diagram or notation
6406532786896.Source diagram or notation
6406532786897.Source diagram or notation
6406532786898.Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q203

Question 204 MCQ · 3.0 marks

Source diagram or notation
Based on the above data answer the given subquestions.
Source diagram or notation
6406532786899.Source diagram or notation
6406532786900.Source diagram or notation
6406532786901.Source diagram or notation
6406532786902.Source diagram or notation
6406532786903.Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q204

Question 205 NAT · 1.0 marks

The notion of treewidth can be defined in several ways. One way to frame the definition of treewidth is by using the following game called the cops-and-robber game. The game consists of a set of cops trying to catch a robber. The robber lives in the graph and can move with infinite speed along the edges of the graph. He cannot, however, move through a vertex should a cop be guarding it. The cops move about in helicopters, the point being that they are not constrained to move along the edges of the graph, but they have finite speed. The game proceeds as follows. Initially, the robber occupies some vertex of the graph. The cops announce their positions (a set of vertices) and move towards them with finite speed. Seeing their positions, the robber announces his position (a vertex) and moves to that vertex instantaneously. Not all cops need land on vertices at once and not all cops need change positions, that is, if a cop occupies a vertex, it may continue occupying that vertex in the next move of the game. The cops catch the robber when one of them lands on a vertex occupied by him. For example, on a cycle of length more than three, the robber can always escape a single cop. We are interested in finding the smallest number of cops we need to deploy to ensure that the robber can be caught in a finite number of rounds of this game. Based on the above data answer the given subquestions.
How many cops are necessary and sufficient to catch the robber on a path?

A published solution is not available for this question yet.

Report a correction for Q205

Question 206 NAT · 2.0 marks

The notion of treewidth can be defined in several ways. One way to frame the definition of treewidth is by using the following game called the cops-and-robber game. The game consists of a set of cops trying to catch a robber. The robber lives in the graph and can move with infinite speed along the edges of the graph. He cannot, however, move through a vertex should a cop be guarding it. The cops move about in helicopters, the point being that they are not constrained to move along the edges of the graph, but they have finite speed. The game proceeds as follows. Initially, the robber occupies some vertex of the graph. The cops announce their positions (a set of vertices) and move towards them with finite speed. Seeing their positions, the robber announces his position (a vertex) and moves to that vertex instantaneously. Not all cops need land on vertices at once and not all cops need change positions, that is, if a cop occupies a vertex, it may continue occupying that vertex in the next move of the game. The cops catch the robber when one of them lands on a vertex occupied by him. For example, on a cycle of length more than three, the robber can always escape a single cop. We are interested in finding the smallest number of cops we need to deploy to ensure that the robber can be caught in a finite number of rounds of this game. Based on the above data answer the given subquestions.
How many cops are necessary and sufficient to catch the robber on a tree?

A published solution is not available for this question yet.

Report a correction for Q206

Question 207 NAT · 2.0 marks

The notion of treewidth can be defined in several ways. One way to frame the definition of treewidth is by using the following game called the cops-and-robber game. The game consists of a set of cops trying to catch a robber. The robber lives in the graph and can move with infinite speed along the edges of the graph. He cannot, however, move through a vertex should a cop be guarding it. The cops move about in helicopters, the point being that they are not constrained to move along the edges of the graph, but they have finite speed. The game proceeds as follows. Initially, the robber occupies some vertex of the graph. The cops announce their positions (a set of vertices) and move towards them with finite speed. Seeing their positions, the robber announces his position (a vertex) and moves to that vertex instantaneously. Not all cops need land on vertices at once and not all cops need change positions, that is, if a cop occupies a vertex, it may continue occupying that vertex in the next move of the game. The cops catch the robber when one of them lands on a vertex occupied by him. For example, on a cycle of length more than three, the robber can always escape a single cop. We are interested in finding the smallest number of cops we need to deploy to ensure that the robber can be caught in a finite number of rounds of this game. Based on the above data answer the given subquestions.
How many cops are necessary and sufficient to catch the robber on a cycle?

A published solution is not available for this question yet.

Report a correction for Q207

Question 208 MCQ · 2.0 marks

The notion of treewidth can be defined in several ways. One way to frame the definition of treewidth is by using the following game called the cops-and-robber game. The game consists of a set of cops trying to catch a robber. The robber lives in the graph and can move with infinite speed along the edges of the graph. He cannot, however, move through a vertex should a cop be guarding it. The cops move about in helicopters, the point being that they are not constrained to move along the edges of the graph, but they have finite speed. The game proceeds as follows. Initially, the robber occupies some vertex of the graph. The cops announce their positions (a set of vertices) and move towards them with finite speed. Seeing their positions, the robber announces his position (a vertex) and moves to that vertex instantaneously. Not all cops need land on vertices at once and not all cops need change positions, that is, if a cop occupies a vertex, it may continue occupying that vertex in the next move of the game. The cops catch the robber when one of them lands on a vertex occupied by him. For example, on a cycle of length more than three, the robber can always escape a single cop. We are interested in finding the smallest number of cops we need to deploy to ensure that the robber can be caught in a finite number of rounds of this game. Based on the above data answer the given subquestions.
How many cops are definitely enough to catch the robber on a graph of treewidth k?
6406532786907.Source diagram or notation
6406532786908.Source diagram or notation
6406532786909.Source diagram or notation
6406532786910.Source diagram or notation
      **RL** **Section Id :** 64065359436 **Section Number :** 13 **Section type :** Online **Mandatory or Optional :** Mandatory **Number of Questions :** 8 **Number of Questions to be attempted :** 8 **Section Marks :** 40 **Display Number Panel :** Yes **Section Negative Marks :** 0 **Group All Questions :** No

A published solution is not available for this question yet.

Report a correction for Q208