GATE CS 2023 | Question 54

Algorithms › Algorithm Analysis · MSQ · 2 marks · Answer: A, D

  1. Question 54Algorithmsmsq2 marks
    Function 1: while n>1: for i=1..n: x++; n=floor(n/2). Function 2: for i=1..100*n: x++. count the x++ executions. Which statements are TRUE?
    • A.
      ✓
    • B.
    • C.
    • D.
      ✓

    Answer: A, D

    Solution

    Answer: (A) and (D) . . Since both are : (A) and (D). They are the same order, so (B) and (C) are false.

More GATE PYQ on Algorithm Analysis

All GATE CS Algorithms PYQ →

Attempt GATE CS 2023 in real GATE exam mode

Full paper with a timer, the GATE interface and a topic-wise analysis — free.

Create free account →