Consider the function computeS(X) whose pseudocode is given below: Which ONE…

Consider the function computeS(X) whose pseudocode is given below:

Which ONE of the following values is returned by the function computeS(X) for X = [6, 3, 5, 4, 10]?

  1. A.

    [1, 1, 2, 3, 4]

  2. B.

    [1, 1, 2, 3, 3]

  3. C.

    [1, 1, 2, 1, 2]

  4. D.

    [1, 1, 2, 1, 5]

Attempted by 996 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…