Quiz Space

Programming, Data Structures and Algorithms using Python · Quiz 2 · 4 Aug 2024 · May 2024 term

Question 3: Consider a directed graph G with equal edge weights. Whic…

Question 3

+3 marksOne correct option

Consider a directed graph G with equal edge weights. Which of the following algorithms is most efficient to compute the shortest distance between every pair of nodes in G?

  1. A

    Run BFS once on every node

  2. B

    Run Dijkstra’s algorithm once on every node

  3. C

    Run Bellman Ford’s algorithm once on every node

  4. D

    Run Floyd-Warshall algorithm

Show answer

Correct answer

  • A

    Run BFS once on every node

Question 3 of 16 in the IIT Madras BS Programming, Data Structures and Algorithms using Python (PDSA) Quiz 2 paper sat on 4 Aug 2024, in the May 2024 term (IIT M DIPLOMA AN EXAM QDD2 4 Aug 2024). It carries 3 marks.

More questions from this paper

  1. Q1Figure question
  2. Q2Figure question
  3. Q4Figure question
  4. Q5Figure question
  5. Q6Which one of the following is a possible sequence of elements in root-to-leaf paths in a top-down fashion in a binary s…
  6. Q7While inserting the elements 45, 75, 15, 55, 5, 40, 62, 25, and 85 in an empty binary search tree in the sequence shown…
  7. Q8Figure question
  8. Q9Figure question
  9. Q10Figure question
  10. Q11Let G be a complete undirected graph with 5 vertices and 10 edges with weights of 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10. The…
  11. Q12Figure question
  12. Q13Figure question
  13. Q14Which of the following statements is/are true for Heap sort?
  14. Q15For a set of symbols with probabilities of occurrence, which of the following statement(s) is/are true about the Huffma…
  15. Q16Figure question