Quiz Space

PDSA Quiz 2: 6 August 2023 (May 2023 term)

Question 1

+3 marksOne correct option

Consider the following strategy to solve the single source shortest path problem with positive integer edge weights from a source vertex s:
Replace each edge with weight w by w edges of weight 1 connected by new intermediate nodes. Run BFS(s) on the modified graph to find the shortest path to each of the original vertices in the graph.
Which of the following statement is true?

  1. A

    This strategy will not solve the problem correctly.

  2. B

    This strategy will only work if the graph is acyclic.

  3. C

    This strategy will solve the problem correctly and is as efficient as Dijkstra’s algorithm.

  4. D

    This strategy will solve the problem correctly, but is not as efficient as Dijkstra’s algorithm.

Question 2

+3 marksOne or more correct options

Which of the following statements is true about Dijkstra's algorithm to find the shortest path?

Select all that apply.

  1. A

    Dijkstra’s algorithm may fail for graphs with negative weights because it does not reconsider a node once it marks it as visited, even if a shorter path exists than the previous one.

  2. B

    The shortest path between two vertices u and v in a graph G always remains unaltered when all the edges of G are incremented by an equal amount.

  3. C

    The shortest path between two vertices u and v in a graph G always remains unaltered when all the edges of G are multiplied by a positive integer.

  4. D

    To decide which node to visit next, Dijkstra's algorithm selects the node with the smallest known distance.

Question 3

+3 marksNumerical answer

13 more questions in this paper

Sign in with Google — it is free — to see every question with its answer and explanation, practise it in learning mode, or take it as a timed mock test.

More on the PDSA Quiz 2 6 Aug 2023 paper

The IIT Madras BS Programming, Data Structures and Algorithms using Python (PDSA) Quiz 2 paper sat on 6 Aug 2023, in the May 2023 term: 16 questions for 50 marks in 120 minutes. The first 3 questions are below. Sign in with Google — it is free — to see the whole paper with its answers and explanations, in learning mode or as a timed mock test.

FeaturePDSA Quiz 2 6 Aug 2023 at a glance
TermMay 2023 term
SubjectProgramming, Data Structures and Algorithms using Python
Course codeBSCS2002
Questions16
Marks50
Duration120 min
MCQ8
MSQ4
Numerical4
Official paperIIT M FOUNDATION AN2 EXAM QPF2 06 Aug 2023
Negative markingNo negative marking.
Updated

Same Quiz 2, other subjects

More PDSA