Quiz Space

Computational Thinking · End Term · 3 Apr 2022 · January 2022 term

Question 19: The values of length(outList) and A will be same at the …

Question 19

+2 marksOne correct option

The following pseudocode is executed using the “Words” dataset. Study the given pseudocode and answer the given subquestions.

text
A = 0, flag = True
inList = [ ], outList = [ ]
while (Table 1 has more rows) {
Read the first row X in Table 1
if (flag) {
inList = [X.Word]
flag = False
}
if (X.Word ends with a full stop) {
outList = outList ++ [[X.Word] ++ inList]
A = A + 1
inList = [ ]
flag = True
}
Move X to Table 2
}

The values of length(outList) and A will be same at the end of execution.

  1. A

    TRUE

  2. B

    FALSE

Show answer

Correct answer

  • A

    TRUE

Question 19 of 27 in the IIT Madras BS Computational Thinking (Computational Thinking (CT)) End Term paper sat on 3 Apr 2022, in the January 2022 term (IIT M FOUNDATION DIPLOMA ENDTERM FN1 3 Apr 2022). It carries 2 marks.

More questions from this paper

  1. Q1Let X and Y be two rows in the “Library” table. We call X and Y compatible if books in rows X and Y are either publishe…
  2. Q2The following pseudocode is executed using the “Scores” dataset. Two students form a study pair if the difference of th…
  3. Q3The following pseudocode is executed using the “Scores” dataset. Two students form a study pair if the difference of th…
  4. Q4Consider a graph generated from n rows of “Scores” table that is represented by a matrix M. Each node in the graph corr…
  5. Q5Which of the following indicates that student i has scored the minimum marks in subject S?
  6. Q6There will be an edge from word i to j if:
  7. Q7Every pair of nodes with the same part of speech is connected by an edge.
  8. Q8What will be the values of A and B at the end of execution of pseudocode given below?
  9. Q9What will be the values of A and B at the end of execution of pseudocode given below?
  10. Q10Consider the following graph with five nodes. A is the 5 × 5 adjacency matrix corresponding to this graph. Based on the…
  11. Q11Consider the following graph with five nodes. A is the 5 × 5 adjacency matrix corresponding to this graph. Based on the…
  12. Q12A word is said to be perfect if no letter is repeated. Let isPerfect be a procedure that takes a row X in the “Words” t…
  13. Q13The given pseudocode is executed using the “Words” dataset. C stores the number of nouns which have at least one verb a…
  14. Q14The following pseudocode is executed using the “Scores” table. At the end of the execution, D captures the following in…
  15. Q15The following pseudocode is executed using the “Scores” dataset. What will the value of L represent at the end of the e…
  16. Q16The given pseudocode is executed using the “Words” dataset. What will A represent at the end of execution?
  17. Q17A word is said to be a palindrome if the word obtained by reversing its letters is the same as the original word. For e…
  18. Q18What will outList represent at the end of execution?
  19. Q20Consider a graph generated from the “Scores” table that is represented by a matrix M. Each node in the graph correspond…
  20. Q21Which of the following statements are true about this graph? It is a Multiple Select Question (MSQ).
  21. Q22Choose the correct statement based on given pseudocode.
  22. Q23Choose the correct statement(s) based on given pseudocode. It is a Multiple Select Question (MSQ).\ For all i, j,
  23. Q24What does calculate(3, 2) return?\ NOTE: Enter your answer to the nearest integer.
  24. Q25Which of the following is the output returned by calculate(x, y)?
  25. Q26Consider the given pseudocode, two positive integers, a and b are the input parameters of procedure mystery, where a ≥ …
  26. Q27Consider the given pseudocode, two positive integers, a and b are the input parameters of procedure mystery, where a ≥ …