Indian Institute of Technology Madras
BS Degree Programme · Examination & Study Paper
BSCS1001 · Computational Thinking
All 2025 papers
Examination Instructions & Guidelines
- Solve on notebook/paper first before checking solutions.
- MCQ: Exactly 1 option is correct. Negative marking applies.
- MSQ: One or more options correct. Select all to score.
- NAT: Numerical response. No negative marking.
- Scientific calculator allowed for all calculations.
- Official answer key is sealed at the end of this sheet.
Quiz 1 · 26 Oct 2025 (AN)Quiz 1
Useful Reference Data for this Paper
Q1MCQ4 Marks·Choose one option
- ANumber of words which are adjectives and have at most 3 letters
- BNumber of words which are either not adjectives or have at most 3 letters but not both
- CNumber of words which are either adjectives or have at least 3 letters or both
- DNumber of words which are not adjectives and have at least 3 letters
- Q2MCQ4 Marks·Choose one option

- Aa - (2), b - (3), c - (1), d - (1), e - (2)
- Ba - (2), b - (1), c - (1), d - (5), e - (2)
- Ca - (2), b - (1), c - (3), d - (1), e - (2)
- Da - (1), b - (2), c - (3), d - (1), e - (3)
- Q3MCQ4 Marks·Choose one option

- AMaximum number of books published by an author in a single year.
- BMaximum number of books published in a single year.
- CNumber of authors who have published more than one book in a single year.
- DNumber of authors who have published more than one book.
- Q4MCQ4 Marks·Choose one option
The following pseudocode is executed using the “Library” dataset. At the end of the execution, A captures the number of pairs of books which are published in the same genre and in the same year but in different languages. But the pseudocode may have mistakes. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors.

- ALine 9: B is updated with wrong value
- BLine 12: C is updated with wrong value
- CLine 15: D is updated in wrong place
- DNo errors
- Q5MCQ4 Marks·Choose one option

- ANumber of pairs of students who have different total marks
- BNumber of pairs of students who have same total marks
- CTwice the number of pairs of students who have different total marks
- DTwice the number of pairs of students who have same total marks
- Q6MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q7MCQ4 Marks·Choose one option

- ANumber of students having the same marks in all the three subjects
- BNumber of students having distinct marks in all the three subjects
- CA will always be 0
- DNumber of students having the same marks in any two subjects
- Q8MSQ5 Marks·Choose all correct options
Based on the "Library" dataset, the Procedure biGenre(A) returns True if the author A has written more Fiction books than Non-Fiction books. Assume that the dataset has only these two genres. Choose the correct pseudocode for Procedure biGenre(A).
- A

- B

- C

- D

- A
- Q9MSQ4 Marks·Choose all correct options

- AIn both the pseudocodes, the value of A and B will be same.
- BIn both the pseudocodes, the value of B will be same, but the value of A may be different.
- CIn both the pseudocodes, the value of A will be same, but the value of B may be different.
- DIn both the pseudocodes, the value of A and B may be different.
- Q10MSQ4 Marks·Choose all correct options

- Acount1 represents number of male students whose Mathematics marks are greater than their Physics marks.
- Bcount1 represents number of male students or students whose Mathematics marks are greater than their Physics marks but not both.
- Ccount2 represents number of female students whose Mathematics marks are greater than their Physics marks
- Dcount2 represents number of female students whose Mathematics marks are less than or equal to their Physics marks.
- Q11MSQ4 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q12NAT5 Marks·Write the number
Your answer:
End Term · 31 Aug 2025 (FN)End Term
- Q13MCQ5 Marks·Choose one option

- ADictionary with words as keys mapped to the number of sentences in which the word is present.
- BDictionary with words as keys mapped to the frequency count of the word in the dataset.
- CDictionary with words as keys mapped to the maximum frequency of the word in a sentence.
- DDictionary with words as keys mapped to the number of sentences in which the word is present more than one time.
- Q14MCQ5 Marks·Choose one option

- AA = Number of cities where students have scored the highest marks in Mathematics B = The highest marks in Mathematics
- BA = Number of cities where students have scored the lowest marks in Mathematics B = The highest marks in Mathematics
- CA = Cities where students have scored the lowest marks in Mathematics B = The lowest marks in Mathematics
- DA = Number of cities with the highest Mathematics scores B = The lowest marks in Mathematics
- Q15MCQ5 Marks·Choose one option

- ANumber of students from the cities with the average total marks of the city more than the average total marks of the dataset.
- BNumber of students from the cities with the average total marks of the city less than the average total marks of the dataset.
- CNumber of cities with the average total marks less than the average total marks of the dataset.
- DNumber of cities with the average total marks more than the average total marks of the dataset
- Q16MCQ5 Marks·Choose one option

- ADictionary with authors as keys mapped to the year of publication of their latest book
- BDictionary with authors as keys mapped to the year of publication of their first book
- CDictionary with authors as keys mapped to the year of publication of their second book
- DDictionary with authors as keys mapped to the year of publication of their second latest book
- Q17MCQ5 Marks·Choose one option

- A

- B

- C

- D

- A
- Q18MSQ5 Marks·Choose all correct options

- AThere are 4 cliques of size three present in the graph.
- BThe nodes 0, 1, 2 and 4 form a clique of size four.
- CThe maximum size of clique that appears in the graph is 4.
- DThe nodes 0 and 1 form a clique of size two.
- Q19MSQ5 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q20MSQ5 Marks·Choose all correct options

- AThe first element of both the lists, cumuList and aList, will be same.
- BNumber of elements in cumuList will be one lesser than that of aList.
- CcumuList is a list of numbers in increasing order.
- DNumber of elements in both lists, cumuList and aList, will be different.
- Q21MSQ5 Marks·Choose all correct options

- AN represents maximum number of bills issued to a single customer.
- Bcount represents number of customers.
- CA represents maximum number of bills issued to a single customer.
- DN represents maximum number of bills issued to a single customer from the same shop.
- Q22MSQ6 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q23NAT5 Marks·Write the number
Your answer: - Q24NAT5 Marks·Write the number
Your answer: - Q25NAT5 Marks·Write the number
Your answer: - Q26NAT4 Marks·Write the number
Your answer: Read the passage below, then answer Q27–Q28


Based on the above data, answer the given subquestions.
Q27MCQ5 Marks·Choose one optionWhat does the value length(keys(A[i] [j])) represent?
- AIt is the number of trains that go from station i to j that stop at least one intermediate station.
- BIt is the number of trains that go from station i to j without stopping at any intermediate station.
- CIt is the number of trains that go from station j to i without stopping at any intermediate station.
- DIt is the number of trains that go from station i to j that stop at most one intermediate station.
- Q28MSQ6 Marks·Choose all correct options
ijMin is a procedure that accepts a pair of stations (i, j), and the matrix A as input. It returns a train which goes from i to j by covering the least distance, without stopping at any intermediate station. If there is no train connecting these two stations, the procedure returns -1. The pseudocode may have mistakes. Identify all of them (if any). It is a Multiple Select Question (MSQ).

- AError in line 3
- BError in line 5
- CError in line 6
- DError in line 7
Read the passage below, then answer Q29–Q30
Q29MSQ5 Marks·Choose all correct options
- AnewMatrix [0] [2] = 1
- BnewMatrix [0] [0] = 1
- CnewMatrix [0] [1] = 0
- DnewMatrix [1] [3] = 0
- Q30MCQ5 Marks·Choose one option

- A1
- B2
- C3
- D4
Read the passage below, then answer Q31–Q32
Q31MCQ5 Marks·Choose one optionWhat is the value of D[10] ?
- A7
- B10
- C30
- D20
- Q32NAT4 Marks·Write the number
What is the value of length(keys(D)) ?
Your answer:
End Term · 31 Aug 2025 (AN)End Term
- Q33MCQ5 Marks·Choose one option

- A

- B

- C

- D

- A
- Q34MCQ5 Marks·Choose one option

- A

- B

- C

- D

- A
- Q35MCQ5 Marks·Choose one option

- ANumber of students from the cities with the average total marks of the city greater than the average total marks of the dataset.
- BNumber of students from the cities with the average total marks of the city less than the average total marks of the dataset.
- CNumber of cities with the average total marks less than the average total marks of the dataset.
- DNumber of cities with the average total marks more than the average total marks of the dataset
- Q36MCQ5 Marks·Choose one option

- ADictionary with authors as keys mapped to the year of publication of their latest book
- BDictionary with authors as keys mapped to the year of publication of their first book
- CDictionary with authors as keys mapped to the year of publication of their second book
- DDictionary with authors as keys mapped to the year of publication of their second latest book
- Q37MCQ5 Marks·Choose one option

- ANumber of pairs of students with different gender or same Town/City
- BNumber of pairs of students with same gender or different Town/City
- CNumber of pairs of students with different gender and same Town/City
- DNumber of pairs of students with same gender and different Town/City
- Q38MSQ5 Marks·Choose all correct options

- AThere are 5 cliques of size three present in the graph.
- BThe nodes 0, 2, 3 and 4 form a clique of size four.
- CThe maximum size of clique that appears in the graph is 3.
- DThe nodes 1, 2 and 3 form a clique of size three.
- Q39MSQ5 Marks·Choose all correct options

- AWhen L = [5, 8, 6, 1, 3], the output of findSomething1(L) is 8.
- BWhen L = [5, 8, 6, 1, 3], the output of findSomething1(L) is 1.
- CWhen L = [5, 8, 6, 1, 3], the output of findSomething2(L) is 8.
- DWhen L = [5, 8, 6, 1, 3], the output of findSomething2(L) is 1.
- Q40MSQ5 Marks·Choose all correct options

- AThe first element of both the lists, cumuList and aList, will be same.
- BNumber of elements in cumuList will be one lesser than that of aList.
- CcumuList is a list of numbers in decreasing order.
- DNumber of elements in both lists, cumuList and aList, will be different.
- Q41MSQ5 Marks·Choose all correct options

- AN represents maximum number of bills issued to a single customer.
- Bcount represents number of customers.
- CAt the end of the execution, the value of A will be 1.
- DN represents maximum number of bills issued to a single customer from the same shop.
- Q42MSQ6 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q43NAT5 Marks·Write the number
Your answer: - Q44NAT5 Marks·Write the number
Your answer: - Q45NAT5 Marks·Write the number
Your answer: - Q46NAT4 Marks·Write the number
Your answer: Read the passage below, then answer Q47–Q48
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.
Q47MSQ5 Marks·Choose all correct optionsIf (i, j) is a pair of stations, which of the following statements about the dictionary A[i][j] are true?
- AEach key corresponds to a train that goes from station i to j without stopping at any intermediate station.
- BEach key corresponds to a train that goes from station i to j. It may stop at multiple stations between i and j.
- CThe value corresponding to key t of the dictionary is the distance between stations i and j on t’s route.
- DThe value corresponding to key t of the dictionary is the minimum distance between stations i and j on t’s route.
- Q48MSQ6 Marks·Choose all correct options
ijMin is a procedure that accepts a pair of stations (i, j), and the matrix A as input. It returns a train which goes from i to j by covering the least distance, without stopping at any intermediate station. If there is no train connecting these two stations, the procedure returns -1. The pseudocode may have mistakes. Identify all of them (if any).
Based on the above data, answer the given subquestions.- AError in line 3
- BError in line 5
- CError in line 7
- DError in line 9
Read the passage below, then answer Q49–Q50
Let 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.
ListV represents the list of vertices of the graph G.

Based on the above data, answer the given subquestions.
Q49MSQ5 Marks·Choose all correct options
- AnewMatrix [2] [4] = 1
- BnewMatrix [1] [1] = 0
- CnewMatrix [3] [0] = 1
- DnewMatrix [1] [3] = 0
- Q50MCQ5 Marks·Choose one option

- A3
- B5
- C6
- D9
Read the passage below, then answer Q51–Q52
Consider the implementation of the following procedure getDictionary.
Assume that the procedure absolute takes an integer as parameter and returns the absolute value. For example, absolute(-2) = 2 and absolute(3) = 3.

Let D be the value returned by getDictionary([5, 10, 20, 30, 20, 10, 20, 5, 15]). Answer the given subquestions based on D.
Q51MCQ5 Marks·Choose one optionWhat is the value of D[20] ?
- A7
- B10
- C30
- D20
- Q52NAT4 Marks·Write the number
What is the value of length(keys(D)) ?
Your answer:
Quiz 2 · 3 Aug 2025 (AN)Quiz 2
Useful Reference Data for this Paper

Q53MCQ4 Marks·Choose one option
- A

- B

- C

- D

- A
- Q54MCQ4 Marks·Choose one option

- A[6, 3, 2, 5, 1, 4]
- B[6, 2, 3, 1, 5, 4]
- C[4, 1, 5, 2, 3, 6]
- D[1, 4, 5, 2, 3, 6]
- Q55MCQ4 Marks·Choose one option

- A{'a': 4, 'b': 3, 'c': 2, 'd': 2, 'e': 1}
- B{'a': 3, 'b': 4, 'c': 2, 'd': 2, 'e': 1}
- C{'a': 4, 'b': 2, 'c': 2, 'd': 2, 'e': 1}
- D{'a': 4, 'b': 3, 'c': 2, 'd': 1, 'e': 2}
- Q56MCQ4 Marks·Choose one option

- AThe list of nouns that come immediately after an article
- BThe list of articles that come immediately after a noun
- CThe list of nouns that come immediately before an article
- DThe list of articles that come immediately before a noun
- Q57MCQ5 Marks·Choose one option

- AA = Number of cities where students score the lowest marks in Physics B = The lowest marks in Physics
- BA = Number of cities where students score the highest marks in Physics B = The lowest marks in Physics
- CA = Cities where students score the highest marks in Physics B = The highest marks in Physics
- DA = Number of cities where students score the lowest marks in Physics B = The highest marks in Physics
- Q58MSQ5 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q59MSQ5 Marks·Choose all correct options

- AError in Line 2
- BError in Line 3
- CError in Line 5
- DError in Line 8
- Q60MSQ4 Marks·Choose all correct options

- A

- B

- C

- D

- A
Read the passage below, then answer Q61–Q62

Based on the above data, answer the given subquestions.
Q61MSQ4 Marks·Choose all correct optionsAt the end of execution of pseudocode, which of the following statements is/are correct?
- AB represents maximum number of nouns in a sentence across all sentences.
- BwList represents the list of part of speech of all words in the dataset.
- CA represents number of Noun in a particular sentence.
- DwList represents the list of part of speech of words in a last sentence.
- Q62MCQ3 Marks·Choose one option
What will length(sList) represent at the end of the execution?
- ATotal number of words in the "Words" dataset.
- BTotal number of sentences in the "Words" dataset.
- CTotal number of words with the same part of speech in the "Words" dataset.
- DTotal number of words with different parts of speech in the "Words" dataset.
Read the passage below, then answer Q63–Q64
Q63MCQ4 Marks·Choose one optionWhat will the value of L be at the end of execution?
- A6
- B1
- C11
- D4
- Q64MCQ4 Marks·Choose one option
What will the value of LC be at the end of execution?
- A[[1], [2, 2], [1, 2, 3]]
- B[[1], [2, 2], [3, 2, 1]]
- C[[3, 2, 1], [2, 2], [1]]
- D[[1, 2, 3], [2, 2], [1]]
End Term · 13 Apr 2025 (FN)End Term
- Q65MCQ5 Marks·Choose one option

- ADictionary with words as keys mapped to the number of sentences in which the word is present.
- BDictionary with words as keys mapped to the frequency count of the word in the dataset.
- CDictionary with words as keys mapped to the maximum frequency of the word in a sentence.
- DDictionary with words as keys mapped to the number of sentences in which the word is present more than one time.
- Q66MCQ5 Marks·Choose one option

- AA = Number of cities where students score the highest marks in Mathematics B = The highest marks in Mathematics
- BA = Number of cities where students score the lowest marks in Mathematics B = The highest marks in Mathematics
- CA = Cities where students score the lowest marks in Mathematics B = The lowest marks in Mathematics
- DA = Number of cities with the highest Mathematics scores B = The lowest marks in Mathematics
- Q67MCQ5 Marks·Choose one option

- A0
- B2
- C4
- D6
- Q68MCQ5 Marks·Choose one option

- AA dictionary where each city maps to the highest total marks scored and the corresponding student's name.
- BA dictionary where each city maps to the lowest total marks scored and the corresponding student's name.
- CA dictionary where each city maps to the lowest total marks recorded in that city.
- DNone of these
- Q69MCQ6 Marks·Choose one option

- Athey are from different cities/towns
- Bthey have the same gender
- Cthey are from the same cities/towns or have the same gender
- Dthey are from the same cities/towns but have different genders
- Q70MCQ6 Marks·Choose one option

- Aj scored at most 20 and at least 30 more marks in Chemistry than i
- Bi scored at most 20 and at least 30 more marks in Chemistry than j
- Ci scored at least 20 and at most 30 more marks in Chemistry than j
- Dj scored at least 20 and at most 30 more marks in Chemistry than i
- Q71MSQ5 Marks·Choose all correct options

- AoutList represents a list of lists
- BEach element in outList represents a list containing words and their parts of speech from a sentence except for the nouns
- CEach element in outList corresponds to one character from the paragraph
- DEach element in outL ist represents the words from a sentence that have part of speech 'noun'
- Q72MSQ5 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q73MSQ4 Marks·Choose all correct options
Let D be a non-empty dictionary defined as: D = { "x": [10, 20, 30], "y": [5, 15, 25], "z": { "a": 100, "b": 200 }, "w": "a" } Choose the correct option(s). It is a Multiple Select Question (MSQ).
- AThe expression first(D["x"]) + last(D["y"]) evaluates to 35.
- BThe expression init(D["z"]) returns "a":100.
- CThe expression length(keys(D)) returns 4.
- DThe expression first(rest(D["x"])) returns 30.
- Q74MSQ6 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q75NAT5 Marks·Write the number
Your answer: - Q76NAT5 Marks·Write the number
Your answer: Read the passage below, then answer Q77–Q78

Based on the above data, answer the given subquestions.
Q77MCQ4 Marks·Choose one option
- ARevenue generated by item j for shop i
- BRevenue generated by item i for shop j
- CCost of item i in shop j
- DCost of item j in shop i
- Q78MCQ4 Marks·Choose one option
What will costD[i] represent at the end of the execution?
- AList of item(s) which generated highest revenue for shop i
- BList of item(s) which generated lowest revenue for shop i
- CList of cost of most sold item(s) in shop i
- DList of cost of least sold item(s) in shop i
Read the passage below, then answer Q79–Q80
The following table contains information regarding books in a library. Each entry in the table corresponds to a book and is authored by at least two authors. There is a pool of n authors, each author being assigned a unique index between 0 and n − 1. There are M books in total.

The table is represented by a dictionary named books, with the keys as serial numbers and values as the corresponding list of authors. Assume that books has already been computed. For example, we have: books[0] = [0, 2, 3].
Based on the above data, answer the given subquestions.
Q79MCQ5 Marks·Choose one optionThe following pseudocode generates a graph G from books. Each node corresponds to an author. There is an edge between two different authors j and k if they have co-authored a book, and the edge is labeled with the number of books they have co-authored. Choose the correct code fragment to complete the following pseudocode.

- A

- B

- C

- D

- A
- Q80MCQ5 Marks·Choose one option
The following pseudocode creates adjacency matrix matrix2 of another graph H from books. For two different authors j and k, what does the value matrix2[j] [k] represent at the end of the execution?

- AList of authors who have co-authored a book with both j and k
- BList of authors who have co-authored a book with either j or k
- CList of authors who have co-authored at least two book with both j and k
- DList of authors who have co-authored at least two book with either j or k
Read the passage below, then answer Q81–Q82
Let 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.
ListV represents the list of vertices of the graph G.

Based on the above data, answer the given subquestions.
Q81MCQ5 Marks·Choose one option
- Ap = 0, q = 0
- Bp = 1, q = 0
- Cp = 0, q = 1
- Dp = 1, q = 1
- Q82MCQ5 Marks·Choose one option

- A1
- B2
- C3
- D4
Read the passage below, then answer Q83–Q84
The following pseudocode is executed using the “Scores” dataset. Two students form a study pair if their difference in Mathematics marks are at most 10. Assume that Pile P1 is always restored back after calling studyPair(Pile P1).

Based on the above data, answer the given subquestions.
Q83MCQ5 Marks·Choose one optionWhat will count1 represent at the end of execution?
- ANumber of study pairs
- BNumber of pairs of study pair
- CNumber of students who formed study pairs
- DNumber of study pairs from the same city
- Q84MCQ5 Marks·Choose one option
What will count3 represent at the end of execution?
- ANumber of study pairs where at least one student in the pair is not from the cities Chennai, Bengaluru, and Vellore
- BNumber of study pairs where both students in the pair are not from the same city among Chennai, Bengaluru and Vellore
- CNumber of study pairs where both students in the pair are from the same city among Chennai, Bengaluru and Vellore
- DNone of these
End Term · 13 Apr 2025 (AN)End Term
- Q85MCQ5 Marks·Choose one option

- A

- B

- C

- D

- A
- Q86MCQ5 Marks·Choose one option

- A

- B

- C

- D

- A
- Q87MCQ5 Marks·Choose one option

- A1
- B3
- C5
- D9
- Q88MCQ6 Marks·Choose one option

- Athey are from different cities/towns
- Bthey have the same gender
- Cthey are from the different cities/towns and have different genders
- Dthey are from the same cities/towns or have the different genders
- Q89MCQ6 Marks·Choose one option

- Aj scored at most 20 and at least 30 more marks in Mathematics than i
- Bi scored at most 20 and at least 30 more marks in Mathematics than j
- Ci scored at least 20 and at most 30 more marks in Mathematics than j
- Dj scored at least 20 and at most 30 more marks in Mathematics than i
- Q90MSQ5 Marks·Choose all correct options

- AoutList represents a list of lists
- BEach element in outList represents a list containing words and their parts of speech from a sentence except for the adjectives
- CEach element in outList corresponds to one sentence from the paragraph
- DEach element in outList represents the words from a sentence that have part of speech 'adjective'
- Q91MSQ5 Marks·Choose all correct options

- AA dictionary where each gender maps to the total number of students for each city.
- BA dictionary where each city maps to the total number of students for each gender.
- CA dictionary where each city maps to the total number of students.
- DNone of these
- Q92MSQ5 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q93MSQ4 Marks·Choose all correct options
Let D be a non-empty dictionary defined as: D = { "x": [10, 20, 30], "y": [5, 15, 25], "z": { "a": 100, "b": 200 }, "w": "a" } Choose the correct option(s). It is a Multiple Select Question (MSQ).
- AThe expression last(D["x"]) + init(D["y"]) evaluates to 35.
- BThe expression init(D["z"]) returns "a":100.
- CThe expression length(D["z"]) returns 2.
- DThe expression last(rest(D["x"])) returns 30.
- Q94MSQ6 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q95NAT5 Marks·Write the number
Your answer: - Q96NAT5 Marks·Write the number
Your answer: Read the passage below, then answer Q97–Q98

Based on the above data, answer the given subquestions.
Q97MCQ4 Marks·Choose one option
- ARevenue generated by item j for shop i
- BRevenue generated by item i for shop j
- CCost of item i in shop j
- DCost of item j in shop i
- Q98MCQ4 Marks·Choose one option
What will costD[i] represent at the end of the execution?
- AList of item(s) which generated highest revenue for shop i
- BList of item(s) which generated lowest revenue for shop i
- CList of cost of most sold item(s) in shop i
- DList of cost of least sold item(s) in shop i
Read the passage below, then answer Q99–Q100

Based on the above data, answer the given subquestions.
Q99MCQ5 Marks·Choose one optionThe following pseudocode generates a graph G from books. Each node corresponds to an author. For two different authors j and k, what does the value matrix[j] [k] represent at the end of the execution?

- ANumber of books that they have co-authored
- BList of books that they have co-authored
- CTotal number of books authored by both the authors
- DTotal number of books authored by either j or k or both
- Q100MSQ5 Marks·Choose all correct options
The following pseudocode creates adjacency matrix matrix2 of another graph H from books. For two different authors j and k, matrix2[j] [k] represents list of authors who have co-authored a book with both j and k. Choose the correct code fragment to complete the following pseudocode.

- A

- B

- C

- D

- A
Read the passage below, then answer Q101–Q102
Let 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.
ListV represents the list of vertices of the graph G.

Answer the given subquestions.
Q101MCQ5 Marks·Choose one optionConsider the below pseudocode
What will the values of p and q be at the end of execution of pseudocode given below?

- Ap = 0, q = 0
- Bp = 1, q = 0
- Cp = 0, q = 1
- Dp = 1, q = 1
- Q102MCQ5 Marks·Choose one option
Consider the below pseudocode.
What will be the of value of count at the end of the execution?- A0
- B1
- C2
- D3
Read the passage below, then answer Q103–Q104
The following pseudocode is executed using the “Scores” dataset. Two students form a study pair if their difference in Mathematics marks are at most 10. Assume that Pile P1 is always restored back after calling studyPair(Pile P1).

Based on the above data, answer the given subquestions.
Q103MSQ5 Marks·Choose all correct optionsWhich of the following statements is/are correct after psuedocode is executed?
- Acount1 represents number of study pairs
- Bcount1 represents total number of students
- Ccount2 represents number of study pair where both the students in each pair are from the same city among Chennai, Bengaluru and Vellore
- Dcount2 represents number of study pair where both the students in each pair are not from the same city among Chennai, Bengaluru and Vellore
- Q104MSQ5 Marks·Choose all correct options
Which of the following statements is/are correct after psuedocode is executed ?
- AstudyPair(Pile CHN) will give the number of study pairs where both students in the pair are from Chennai.
- BstudyPair(Pile CHN) will give the number of study pairs where both students in the pair are not from Chennai.
- Ccount3 represents number of study pairs where both students in the pair are not from the same city among Chennai, Bengaluru and Vellore
- Dcount3 represents number of study pairs where both students in the pair are from the same city among Chennai, Bengaluru and Vellore
Official KeyMaster Answer Key & Explanations
Official answer keys from IIT Madras BS past papers. Click any question to review.
Reveal KeyCollapse Key
Master Answer Key & Explanations
Official answer keys from IIT Madras BS past papers. Click any question to review.