Quiz Space

Computational Thinking · End Term · 31 Aug 2025 · May 2025 term · Set 3

Question 17: Consider the following condensed version of the “Trains”…

Question 17

+5 marksOne or more correct options

Consider the following condensed version of the “Trains” dataset. There are a total of n stations, with stations being indexed from 0 to n − 1. There are M rows in the table. Each row contains information about a train that connects two stations without any stops in between.

Consider the following condensed version of the “Trains” dataset. There are a total of n stations, with stations being indexed from 0 to n − 1. There are M rows in the table. Each row contains information about a train that connects two stations without any stops in between. Row r, tells us that train t departs from station i and arrives at station j after covering a distance of d kilometers without stopping at any intermediate station. Therefore, each train t will occupy multiple rows in this table.
This scenario is modeled as a graph and is represented by a matrix A. Each node in the graph corresponds to a station. Assume that the value of n is already given to you. Consider the following pseudocode.

Consider the following condensed version of the “Trains” dataset. There are a total of n stations, with stations being indexed from 0 to n − 1. There are M rows in the table. Each row contains information about a train that connects two stations without any stops in between. Row r, tells us that train t departs from station i and arrives at station j after covering a distance of d kilometers without stopping at any intermediate station. Therefore, each train t will occupy multiple rows in this table.
This scenario is modeled as a graph and is represented by a matrix A. Each node in the graph corresponds to a station. Assume that the value of n is already given to you. Consider the following pseudocode. Based on the above data, answer the given subquestions.

Consider the following condensed version of the “Trains” dataset. There are a total of n stations, with stations being i
Consider the following condensed version of the “Trains” dataset. There are a total of n stations, with stations being i

If (i, j) is a pair of stations, which of the following statements about the dictionary A[i][j] are true?

Select all that apply.

  1. A

    Each key corresponds to a train that goes from station i to j without stoppingat any intermediate station.

  2. B

    Each key corresponds to a train that goes from station i to j. It may stop atmultiple stations between i and j.

  3. C

    The value corresponding to key t of the dictionary is the distance betweenstations i and j on t’s route.

  4. D

    The value corresponding to key t of the dictionary is the minimum distancebetween stations i and j on t’s route.

Show answer

Correct answers

  • A

    Each key corresponds to a train that goes from station i to j without stoppingat any intermediate station.

  • C

    The value corresponding to key t of the dictionary is the distance betweenstations i and j on t’s route.

Question 17 of 25 in the IIT Madras BS Computational Thinking (Computational Thinking (CT)) End Term paper sat on 31 Aug 2025, in the May 2025 term (IIT M IMPROVEMENT AN EXAM QIB4 31 Aug). It carries 5 marks.

More questions from this paper

  1. Q1THIS IS QUESTION PAPER FOR THE SUBJECT "FOUNDATION LEVEL : COMPUTATIONAL THINKING (COMPUTER BASED EXAM)" ARE YOU SURE Y…
  2. Q2Figure question
  3. Q3Figure question
  4. Q4Figure question
  5. Q5Figure question
  6. Q6Figure question
  7. Q7Figure question
  8. Q8Figure question
  9. Q9Figure question
  10. Q10Figure question
  11. Q11Figure question
  12. Q12Figure question
  13. Q13Figure question
  14. Q14Figure question
  15. Q15Figure question
  16. Q16Figure question
  17. Q18Consider the following condensed version of the “Trains” dataset. There are a total of n stations, with stations being …
  18. Q19Let M be an adjacency matrix of a graph G given below, where M[i][j] = 1 if there is an edge from i to j, otherwise 0. …
  19. Q20Let M be an adjacency matrix of a graph G given below, where M[i][j] = 1 if there is an edge from i to j, otherwise 0. …
  20. Q21Consider the implementation of the following procedure getDictionary. Assume that the procedure absolute takes an integ…
  21. Q22Consider the implementation of the following procedure getDictionary. Assume that the procedure absolute takes an integ…
  22. Q23Consider the following condensed version of the “Trains” dataset. There are a total of n stations, with stations being …
  23. Q24Let M be an adjacency matrix of a graph G given below, where M[i][j] = 1 if there is an edge from i to j, otherwise 0. …
  24. Q25Consider the implementation of the following procedure getDictionary. Assume that the procedure absolute takes an integ…