Data Structures & AlgorithmsHardTCS NQT · Infosys

Starting at value 1, apply the operations x -> 2x, then x -> x + 3, alternating (double, add 3, double, add 3, ...), for 6 operations in total. What is the final value?

  1. A. 30
  2. B. {C+7}
  3. C. 32
  4. D. 29

Correct answer: D. 29

Simulate the six operations in order: 1, 2, 5, 10, 13, 26, 29. Starting the add first gives a different final value.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic