uiz Space

January 2026 term · Computational Thinking · BSCS1001

Computational Thinking End Term: 10 May 2026 (January 2026 term)

The IIT Madras BS Computational Thinking (Computational Thinking (CT)) End Term paper sat on 10 May 2026, in the January 2026 term: 46 questions for 206 marks in 180 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
46
Marks
206
Duration
180 min
MCQ
18
MSQ
19
Written
9

Updated

Official paper: CT 06 May 26 · No negative marking.

Question 1

+1 markOne correct option
Figure from the original question paper
Figure from the original question paper
  1. A

    Useful Data has been mentioned above.

  2. B

    This data attachment is just for a reference & not for an evaluation.

Show answer

Correct answer

  • A

    Useful Data has been mentioned above.

Question 2

+1 markOne correct option
Figure from the original question paper
Figure from the original question paper
  1. A

    Useful Data has been mentioned above.

  2. B

    This data attachment is just for a reference & not for an evaluation.

Show answer

Correct answer

  • A

    Useful Data has been mentioned above.

Question 3

+5 marksOne correct option

The following pseudocode is executed using the "Scores" dataset.

At the end of execution, what does Dict represent?

The following pseudocode is executed using the "Scores" dataset.
  1. A

    A dictionary where each city maps to the lowest total marks scored and the corresponding student's name.

  2. B

    A dictionary where each city maps to the highest total marks scored and the corresponding student's name.

  3. C

    A dictionary where each city maps to the lowest total marks recorded in that city.

  4. D

    None of these

Show answer

Correct answer

  • A

    A dictionary where each city maps to the lowest total marks scored and the corresponding student's name.

Question 4

+5 marksOne correct option

The following pseudocode is executed using the "Shopping Bills" dataset. Assume each customer has a distinct name.

What will N represent at the end of the execution?

The following pseudocode is executed using the "Shopping Bills" dataset. Assume each customer has a distinct name.
  1. A

    Minimum number of bills issued to a single customer

  2. B

    Maximum number of bills issued to a single customer

  3. C

    Number of distinct customers in the dataset

  4. D

    Minimum number of customers who purchased items from the same shop

Show answer

Correct answer

  • A

    Minimum number of bills issued to a single customer

Question 5

+5 marksOne correct option

The following pseudocode is executed using the "Scores" dataset. What will Z represent at the end of the execution?

The following pseudocode is executed using the "Scores" dataset. What will Z represent at the end of the execution?
  1. A

    Number of students from the cities with the average Physics marks of the city less than the average Physics marks of the dataset.

  2. B

    Number of students from the cities with the average Physics marks of the city greater than the average Physics marks of the dataset.

  3. C

    Number of cities with the average Physics marks less than the average Physics marks of the dataset.

  4. D

    Number of cities with the average Physics marks more than the average Physics marks of the dataset

Show answer

Correct answer

  • B

    Number of students from the cities with the average Physics marks of the city greater than the average Physics marks of the dataset.

Question 6

+5 marksOne correct option

The following pseudocode is executed using the "Scores" dataset. What will Z represent at the end of the execution?

The following pseudocode is executed using the "Scores" dataset. What will Z represent at the end of the execution?
  1. A

    Number of students from the cities with the average total marks of the city more than the average total marks of the dataset.

  2. B

    Number of students from the cities with the average total marks of the city less than the average total marks of the dataset.

  3. C

    Number of cities with the average total marks less than the average total marks of the dataset.

  4. D

    Number of cities with the average total marks more than the average total marks of the dataset

Show answer

Correct answer

  • B

    Number of students from the cities with the average total marks of the city less than the average total marks of the dataset.

Question 7

+6 marksOne correct option

Let X and Y be two rows in the "Scores" table. We call X and Y partially matching if student X and Y are either have the same Total Marks or are from the same city, but not both. Let partialMatch(X, Y) be a procedure to find whether X and Y are partially matching. Choose the correct implementation of the procedure partialMatch.

  1. A
    Figure from the original question paper
  2. B
    Figure from the original question paper
  3. C
    Figure from the original question paper
  4. D
    Figure from the original question paper
Show answer

Correct answer

  • C
    Figure from the original question paper

Question 8

+6 marksOne correct option

Let X and Y be two rows in the "Scores" table. We call X and Y partially matching if student X and Y either have the same DOB or are from the same city, but not both. Let partialMatch(X, Y) be a procedure to find whether X and Y are partially matching. Choose the correct implementation of the procedure partialMatch.

  1. A
    Figure from the original question paper
  2. B
    Figure from the original question paper
  3. C
    Figure from the original question paper
  4. D
    Figure from the original question paper
Show answer

Correct answer

  • C
    Figure from the original question paper

Question 9

+6 marksOne correct option

The following pseudocode is executed using the "Scores" dataset. What will the value of B represent at the end of execution?

The following pseudocode is executed using the "Scores" dataset. What will the value of B represent at the end of execut
  1. A

    Number of repeated marks in Physics

  2. B

    Minimum marks in Physics

  3. C

    Maximum marks in Physics

  4. D

    Most frequent marks in Physics

Show answer

Correct answer

  • D

    Most frequent marks in Physics

Question 10

+4 marksOne correct option

The following pseudocode is executed using the "Library" dataset. What will B represent at the end of execution?

The following pseudocode is executed using the "Library" dataset. What will B represent at the end of execution?
  1. A

    Number of books written by author Kalam in Hindi

  2. B

    Number of books written by author Kalam that are not in Hindi

  3. C

    Number of Hindi books written by authors other than Kalam

  4. D

    Number of books that are not written by author Kalam and are in Hindi

Show answer

Correct answer

  • D

    Number of books that are not written by author Kalam and are in Hindi

Question 11

+4 marksOne correct option

The following pseudocode is executed using the "Library" dataset. What will B represent at the end of execution?

The following pseudocode is executed using the "Library" dataset. What will B represent at the end of execution?
  1. A

    Number of books written by author Kalam that have at least 200 pages

  2. B

    Number of books not written by author Kalam and that have at least 200 pages

  3. C

    Number of books written by author Kalam that have fewer than 200 pages

  4. D

    Number of books that are not written by author Kalam and have fewer than 200 pages

Show answer

Correct answer

  • D

    Number of books that are not written by author Kalam and have fewer than 200 pages

Question 12

+6 marksOne or more correct options

Consider the following pseudocode is executed using the "Words" dataset.

Which of the following statements is/are true?

Consider the following pseudocode is executed using the "Words" dataset.

Select all that apply.

  1. A

    A represents the number of sentences in the "Words" dataset that end with a noun

  2. B

    A represents the number of words in the "Words" dataset that are nouns

  3. C

    outList represents a list of lists of last and first word of each sentence in that order.

  4. D

    outList represents a list of lists of first and last word of each sentence in that order.

Show answer

Correct answers

  • A

    A represents the number of sentences in the "Words" dataset that end with a noun

  • C

    outList represents a list of lists of last and first word of each sentence in that order.

Question 13

+5 marksOne or more correct options

Consider a graph generated from the "Scores" table that is represented by a matrix B. Each node in the graph corresponds to a student from the table. SeqNo is used to label the nodes in the graph. Which of the following statements are true about this graph?

Consider a graph generated from the "Scores" table that is represented by a matrix B. Each node in the graph corresponds

Select all that apply.

  1. A

    There are two cliques in this graph, one for each gender.

  2. B

    In every clique, there is at least a pair of students having different genders.

  3. C

    All students in a given clique have the same gender.

  4. D

    All students in a given clique are from the same city/town.

  5. E

    There are no cliques in this graph.

Show answer

Correct answers

  • C

    All students in a given clique have the same gender.

  • D

    All students in a given clique are from the same city/town.

Question 14

+6 marksOne or more correct options

The following pseudocode finds the smallest integer present in the input list. Choose the correct code fragment to complete the pseudocode.

The following pseudocode finds the smallest integer present in the input list. Choose the correct code fragment to compl

Select all that apply.

  1. A
    Figure from the original question paper
  2. B
    Figure from the original question paper
  3. C
    Figure from the original question paper
  4. D
    Figure from the original question paper
Show answer

Correct answers

  • A
    Figure from the original question paper
  • C
    Figure from the original question paper

Question 15

+5 marksOne or more correct options

Consider the following pseudocode for inserting elements into a sorted list. The pseudocode may have mistakes. Identify all such mistakes (if any).

Consider the following pseudocode for inserting elements into a sorted list. The pseudocode may have mistakes. Identify

Select all that apply.

  1. A

    Line 5: inside if statement condition should be '(not(inserted))'.

  2. B

    Line 6: inside if statement condition should be 'x > z'.

  3. C

    Line 11: [z] needs to be appended to the end of newList.

  4. D

    Line 14: 'x' is appended to the end of the list instead of the beginning.

Show answer

Correct answers

  • A

    Line 5: inside if statement condition should be '(not(inserted))'.

  • C

    Line 11: [z] needs to be appended to the end of newList.

Question 16

+6 marksOne or more correct options

The given pseudocode is executed using the "Words" dataset. At the end of execution A captures the frequency count of the most frequent consonant in the dataset. 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.

The given pseudocode is executed using the "Words" dataset. At the end of execution A captures the frequency count of th

Select all that apply.

  1. A

    Line 1: Incorrect initialization of D

  2. B

    Line 8: Incorrect conditional expression

  3. C

    Line 9: A updated with wrong value

  4. D

    Line 13: Incorrect initialization of i

  5. E

    Line 16: Conditional expression should not use "not" operator

  6. F

    Line 22: i updated at wrong place

Show answer

Correct answers

  • B

    Line 8: Incorrect conditional expression

  • E

    Line 16: Conditional expression should not use "not" operator

Question 17

+5 marksOne or more correct options

Let LA be a non-empty list of integers. A list LB is constructed using the following pseudocode.

Which of the following will return true after the execution of above pseudocode?

Let LA be a non-empty list of integers. A list LB is constructed using the following pseudocode.

Select all that apply.

  1. A

    length(LB) == length(LA) - 1

  2. B

    LC == [50]

  3. C

    last(LB) == [10]

  4. D

    init(first(rest(LB))) == [20]

  5. E

    first(last(LB)) == [50]

  6. F

    first(init(LB)) == [10]

Show answer

Correct answers

  • D

    init(first(rest(LB))) == [20]

  • E

    first(last(LB)) == [50]

  • F

    first(init(LB)) == [10]

Question 18

+6 marksOne or more correct options

Let LA be a non-empty list of integers. A list LB is constructed using the following pseudocode.

Which of the following will return true after the execution of above pseudocode?

Let LA be a non-empty list of integers. A list LB is constructed using the following pseudocode.

Select all that apply.

  1. A

    length(LB) == length(LA) - 1

  2. B

    LC == [50]

  3. C

    last(LB) == LA

  4. D

    init(first(rest(LB))) == [40, 30, 20]

  5. E

    first(last(LB)) == [50]

  6. F

    first(init(LB)) == [50, 40, 30, 20, 10]

Show answer

Correct answers

  • D

    init(first(rest(LB))) == [40, 30, 20]

  • F

    first(init(LB)) == [50, 40, 30, 20, 10]

Question 19

+5 marksOne or more correct options

The following pseudocode is executed using the "Words" dataset. Assume that the rows in the table are sorted in the ascending order of sequence number. What does outList represent at the end of execution?

The following pseudocode is executed using the "Words" dataset. Assume that the rows in the table are sorted in the asce

Select all that apply.

  1. A

    outList represents a list of lists

  2. B

    Each element in outList represents a list containing words and their letter counts from a sentence except for the adjectives

  3. C

    Each element in outList corresponds to one word from the paragraph

  4. D

    Each element in outList represents the words from a sentence that have part of speech 'adjective'

Show answer

Correct answers

  • A

    outList represents a list of lists

  • B

    Each element in outList represents a list containing words and their letter counts from a sentence except for the adjectives

Question 20

+4 marksOne or more correct options

Let D be a non-empty dictionary. Choose the correct option(s).

Select all that apply.

  1. A

    Let a be a key of dictionary D, then a is always a string.

  2. B

    For keys a and b in D, if a != b then D[a] == D[b] may or may not be true.

  3. C

    For keys a and b in D, a != b is always True.

  4. D

    If D = { 'a': 5, 'b' : [3, 4, 7], 'c' : 6}, then the value of rest(D[b]) is [3, 4].

Show answer

Correct answers

  • B

    For keys a and b in D, if a != b then D[a] == D[b] may or may not be true.

  • C

    For keys a and b in D, a != b is always True.

Question 21

+5 marksOne or more correct options

Consider the graph given below.

Which of the following statement(s) is/are true?

Consider the graph given below.

Select all that apply.

  1. A

    Vertex 0 is part of every clique of size 3 in the graph.

  2. B

    There exists a clique of size 4 in the graph.

  3. C

    Vertices 3 and 4 belong to at most one common clique of size 3.

  4. D

    The nodes 0 and 1 form a clique of size two.

Show answer

Correct answers

  • B

    There exists a clique of size 4 in the graph.

  • D

    The nodes 0 and 1 form a clique of size two.

Question 22

+5 marksOne or more correct options

The following pseudocode is executed using the "Library" dataset. At the end of the execution, A stores a dictionary with the author's name as key mapped to the number of books written by him/her. But the code may have mistakes. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors.

The following pseudocode is executed using the "Library" dataset. At the end of the execution, A stores a dictionary wit

Select all that apply.

  1. A

    Replacing the condition given in line 4 with the statement given below will provide the correct result.

    Replacing the condition given in line 4 with the statement given below will provide the correct result.
  2. B

    Interchanging Line 4 and 7 will provide the correct result.

  3. C

    Interchanging Line 5 and 8 will provide the correct result.

  4. D

    The pseudocode will provide the correct result even without getting modified.

Show answer

Correct answers

  • A

    Replacing the condition given in line 4 with the statement given below will provide the correct result.

    Replacing the condition given in line 4 with the statement given below will provide the correct result.
  • C

    Interchanging Line 5 and 8 will provide the correct result.

Question 23

+6 marksOne or more correct options

Consider the following pseudocode is executed using the "Words" dataset.

Which of the following statements is/are true?

Consider the following pseudocode is executed using the "Words" dataset.

Select all that apply.

  1. A

    A represent the number of sentences in the "Words" dataset that do not end with a noun

  2. B

    A represent the number of words in the "Words" dataset that are nouns

  3. C

    outList represents list of lists of first and last word of each sentence in that order.

  4. D

    outList represents list of lists of last and first word of each sentence in that order.

Show answer

Correct answers

  • A

    A represent the number of sentences in the "Words" dataset that do not end with a noun

  • C

    outList represents list of lists of first and last word of each sentence in that order.

Question 24

+5 marksOne or more correct options

Consider the following pseudocode for inserting elements into a sorted list. The pseudocode may have mistakes. Identify all such mistakes (if any).

Which of the following statements is/are true at the end of the execution?

Consider the following pseudocode for inserting elements into a sorted list. The pseudocode may have mistakes. Identify

Select all that apply.

  1. A

    Line 3: variable 'inserted' is initialised to True so it will never enter the nested if block for comparison.

  2. B

    Line 6: inside if statement condition should be 'x > z'.

  3. C

    Line 11: [z] needs to be appended to the end of newList.

  4. D

    Line 14: 'x' is appended to the end of the list instead of the beginning.

Show answer

Correct answers

  • A

    Line 3: variable 'inserted' is initialised to True so it will never enter the nested if block for comparison.

  • C

    Line 11: [z] needs to be appended to the end of newList.

Question 25

+6 marksOne or more correct options

Consider the following procedure, where L1 and L2 are two non-empty lists.

Choose the correct option(s).

Consider the following procedure, where L1 and L2 are two non-empty lists.

Select all that apply.

  1. A

    If L1 = [2, 3, 5], L2 = [2, 4, 5], then CompareLists[L1, L2] returns false.

  2. B

    If L1 = [2, 4, 5], L2 = [5, 4, 2], then CompareLists[L1, L2] returns true.

  3. C

    If L1 = [2, 4, 5], L2 = [2, 5, 4], then CompareLists[L1, L2] returns true.

  4. D

    If L1 = [2, 4, 5], L2 = [3, 4, 2], then CompareLists[L1, L2] returns false.

Show answer

Correct answers

  • A

    If L1 = [2, 3, 5], L2 = [2, 4, 5], then CompareLists[L1, L2] returns false.

  • B

    If L1 = [2, 4, 5], L2 = [5, 4, 2], then CompareLists[L1, L2] returns true.

  • D

    If L1 = [2, 4, 5], L2 = [3, 4, 2], then CompareLists[L1, L2] returns false.

Question 26

+5 marksOne or more correct options

The following pseudocode is executed using the "Words" dataset. Assume that the rows in the table are sorted in the ascending order of sequence number. What does outList represent at the end of execution?

The following pseudocode is executed using the "Words" dataset. Assume that the rows in the table are sorted in the asce

Select all that apply.

  1. A

    outList represents a list of lists

  2. B

    Each element in outList represents a list containing words and their parts of speech from a sentence except for the adjectives

  3. C

    Each element in outList corresponds to one word from the paragraph

  4. D

    Each element in outList represents the words from a sentence that have part of speech 'adjective'

Show answer

Correct answers

  • A

    outList represents a list of lists

  • B

    Each element in outList represents a list containing words and their parts of speech from a sentence except for the adjectives

Question 27

+6 marksOne or more correct options

The given pseudocode is executed using the "Words" dataset. At the end of execution A captures the frequency count of the least frequent consonant in the dataset. 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.

The given pseudocode is executed using the "Words" dataset. At the end of execution A captures the frequency count of th

Select all that apply.

  1. A

    Line 1: Incorrect initialization of A

  2. B

    Line 8: Incorrect conditional expression

  3. C

    Line 9: A updated with wrong value

  4. D

    Line 13: Incorrect initialization of i

  5. E

    Line 16: Conditional expression should not use "not" operator

  6. F

    Line 22: i updated at wrong place

Show answer

Correct answers

  • A

    Line 1: Incorrect initialization of A

  • B

    Line 8: Incorrect conditional expression

  • E

    Line 16: Conditional expression should not use "not" operator

Question 28

+5 marksOne or more correct options

Consider the graph given below.

Which of the following statement(s) is/are true?

Consider the graph given below.

Select all that apply.

  1. A

    There are 3 cliques of size three present in the graph.

  2. B

    The degree of vertex 2 is 4.

  3. C

    The maximum size of clique that appears in the graph is 3.

  4. D

    The nodes 0 and 2 form a clique of size two.

Show answer

Correct answers

  • B

    The degree of vertex 2 is 4.

  • D

    The nodes 0 and 2 form a clique of size two.

Question 29

+4 marksOne or more correct options

Let D be a non-empty dictionary. Choose the correct option(s).

Select all that apply.

  1. A

    Let a be a key of dictionary D, then a is always an integer.

  2. B

    For keys a and b in D, if a != b then D[a] != D[b] may or may not be true.

  3. C

    For keys a and b in D, a == b is always True.

  4. D

    If D = { 'a': 5, 'b' : [3, 4, 7], 'c' : 6}, then the value of init(rest(D[b])) is [4].

Show answer

Correct answers

  • B

    For keys a and b in D, if a != b then D[a] != D[b] may or may not be true.

  • D

    If D = { 'a': 5, 'b' : [3, 4, 7], 'c' : 6}, then the value of init(rest(D[b])) is [4].

Question 30

+5 marksOne or more correct options

reverse is a recursive procedure to reverse a list. Select the correct code fragment to complete the pseudocode given below.

reverse is a recursive procedure to reverse a list. Select the correct code fragment to complete the pseudocode given be

Select all that apply.

  1. A

    return ([last(L)] ++ reverse(init(L)))

  2. B

    return ([first(L)] ++ reverse(rest(L)))

  3. C

    return ([last(L)] ++ reverse(init(rest(L))) ++ [first(L)])

  4. D

    return ([first(L)] ++ reverse(init(rest(L))) ++ [last(L)])

  5. E

    return ([last(L)] ++ reverse(rest(init(L))) ++ [first(L)])

Show answer

Correct answers

  • A

    return ([last(L)] ++ reverse(init(L)))

  • C

    return ([last(L)] ++ reverse(init(rest(L))) ++ [first(L)])

  • E

    return ([last(L)] ++ reverse(rest(init(L))) ++ [first(L)])

Question 31

+5 marksWritten answer

What will the value of S be at the end of the execution of the following pseudocode?

What will the value of S be at the end of the execution of the following pseudocode?
Show answer

A written answer, not marked automatically.

Question 32

+5 marksWritten answer

What will the value of S be at the end of the execution of the following pseudocode?

What will the value of S be at the end of the execution of the following pseudocode?
Show answer

A written answer, not marked automatically.

Question 33

+4 marksWritten answer

Consider the following procedure.

What will the return value of DoSomething(728) be?

Consider the following procedure.
Show answer

A written answer, not marked automatically.

Question 34

+4 marksWritten answer

Consider the following procedure.

What will the return value of DoSomething(456) be?

Consider the following procedure.
Show answer

A written answer, not marked automatically.

Question 35

+4 marksOne correct option

In the following pseudocode: graph is a matrix• parents is a dictionary• sequence is a list•

Consider the following graph with six nodes. A is the 6 × 6 adjacency matrix corresponding to this graph. Assume that it has already been computed:

In given subquestions, S represents a list, P represents a dictionary, while A represents adjacency matrix of the above graph. Based on the above data, answer the given subquestions.

In the following pseudocode: graph is a matrix• parents is a dictionary• sequence is a list•
In the following pseudocode: graph is a matrix• parents is a dictionary• sequence is a list•

What will be the value of S after executing the following pseudocode?

What will be the value of S after executing the following pseudocode?
  1. A

    [0, 1, 2, 5, 3, 4]

  2. B

    [0, 1, 4]

  3. C

    [0, 1, 2, 3, 5, 4]

  4. D

    [0, 3, 1, 4, 5]

Show answer

Correct answer

  • C

    [0, 1, 2, 3, 5, 4]

Question 36

+4 marksOne correct option

The following pseudocode is executing using the “Scores” table. At the end of the execution,matrix represents the adjacency matrix of the graph generated from the “Scores” table.

Based on the above data, answer the given subquestions.

The following pseudocode is executing using the “Scores” table. At the end of the execution,matrix represents the adjace

If matrixPh[i] [j] = 1, then:

  1. A

    i scored at most 10 and at least 20 more marks in Physics than j

  2. B

    i scored at least 10 and at most 20 more marks in Physics than j

  3. C

    j scored at least 10 and at most 20 more marks in Physics than i

  4. D

    j scored at most 10 and at least 20 more marks in Physics than i

Show answer

Correct answer

  • B

    i scored at least 10 and at most 20 more marks in Physics than j

Question 37

+4 marksOne correct option

In the following pseudocode: graph is a matrix• parents is a dictionary• sequence is a list•

Consider the following graph with six nodes. A is the 6 × 6 adjacency matrix corresponding to this graph. Assume that it has already been computed:

In given subquestions, S represents a list, P represents a dictionary, while A represents adjacency matrix of the above graph. Based on the above data, answer the given subquestions.

In the following pseudocode: graph is a matrix• parents is a dictionary• sequence is a list•
In the following pseudocode: graph is a matrix• parents is a dictionary• sequence is a list•

What will be the value of nodes after executing the following pseudocode?

What will be the value of nodes after executing the following pseudocode?
  1. A

    [5, 2, 1, 0, 3, 4]

  2. B

    [5, 2, 1, 4, 0, 3]

  3. C

    [5, 2, 3, 0, 1, 4]

  4. D

    Cannot be determined

Show answer

Correct answer

  • D

    Cannot be determined

Question 38

+4 marksOne correct option

The following pseudocode is executing using the “Scores” table. At the end of the execution,matrix represents the adjacency matrix of the graph generated from the “Scores” table.

Based on the above data, answer the given subquestions.

The following pseudocode is executing using the “Scores” table. At the end of the execution,matrix represents the adjace

Choose the correct statement based on the main data pseudocode.

  1. A

    For all i, j with i ≠ j, + = 1

  2. B

    For all i, j with i ≠ j, if = 1 then = 0

  3. C

    For all i, j with i ≠ j, if = 0 then = 1

  4. D

    For all i, j with i ≠ j, if = 1 then = 1

  5. E

    For all i, j with i ≠ j, if = 0 then = 0

Show answer

Correct answer

  • B

    For all i, j with i ≠ j, if = 1 then = 0

Question 39

+5 marksOne correct option

Let M be an adjacency matrix of a graph G given below, where = 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.

Let M be an adjacency matrix of a graph G given below, where  = 1 if there is an edge from i to j, otherwise 0. ListV re

Consider the below pseudocode

What will be the values of p and q at the end of execution?

Consider the below pseudocode
Consider the below pseudocode
  1. A

    p = 1, q = 1

  2. B

    p = 2, q = 1

  3. C

    p = 1, q = 2

  4. D

    p = 2, q = 2

Show answer

Correct answer

  • B

    p = 2, q = 1

Question 40

+5 marksOne correct option

Let M be an adjacency matrix of a graph G given below, where = 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 sub questions.

Let M be an adjacency matrix of a graph G given below, where  = 1 if there is an edge from i to j, otherwise 0. ListV re

Consider the below pseudocode

What will the values of p and q be at the end of execution of pseudocode given below?

Consider the below pseudocode
Consider the below pseudocode
  1. A

    p = 0, q = 0

  2. B

    p = 1, q = 0

  3. C

    p = 0, q = 1

  4. D

    p = 1, q = 1

Show answer

Correct answer

  • B

    p = 1, q = 0

Question 41

+5 marksWritten answer

Let M be an adjacency matrix of a graph G given below, where = 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.

Let M be an adjacency matrix of a graph G given below, where  = 1 if there is an edge from i to j, otherwise 0. ListV re

Consider the below pseudocode.

What will be the value of count at the end of execution?

Consider the below pseudocode.
Show answer

A written answer, not marked automatically.

Question 42

+5 marksOne correct option

Let M be an adjacency matrix of a graph G given below, where = 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 sub questions.

Let M be an adjacency matrix of a graph G given below, where  = 1 if there is an edge from i to j, otherwise 0. ListV re

Consider the below pseudocode.

What will be the of value of count at the end of the execution?

Consider the below pseudocode.
  1. A

    6

  2. B

    7

  3. C

    8

  4. D

    9

Show answer

Correct answer

  • D

    9

Question 43

+1 markWritten answer

In the following pseudocode: graph is a matrix• parents is a dictionary• sequence is a list•

Consider the following graph with six nodes. A is the 6 × 6 adjacency matrix corresponding to this graph. Assume that it has already been computed:

In given subquestions, S represents a list, P represents a dictionary, while A represents adjacency matrix of the above graph. Based on the above data, answer the given subquestions.

In the following pseudocode: graph is a matrix• parents is a dictionary• sequence is a list•
In the following pseudocode: graph is a matrix• parents is a dictionary• sequence is a list•
Show answer

A written answer, not marked automatically.

Question 44

+1 markWritten answer

Let M be an adjacency matrix of a graph G given below, where = 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.

Let M be an adjacency matrix of a graph G given below, where  = 1 if there is an edge from i to j, otherwise 0. ListV re
Show answer

A written answer, not marked automatically.

Question 45

+1 markWritten answer

The following pseudocode is executing using the “Scores” table. At the end of the execution,matrix represents the adjacency matrix of the graph generated from the “Scores” table.

Based on the above data, answer the given subquestions.

The following pseudocode is executing using the “Scores” table. At the end of the execution,matrix represents the adjace
Show answer

A written answer, not marked automatically.

Question 46

+1 markWritten answer

Let M be an adjacency matrix of a graph G given below, where = 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 sub questions.

Let M be an adjacency matrix of a graph G given below, where  = 1 if there is an edge from i to j, otherwise 0. ListV re
Show answer

A written answer, not marked automatically.