Question:medium

Consider the code:
$X = a * 2$
$Y = a * 2$
After optimization, what is the most efficient transformation?

Show Hint

Replacing multiplication with addition ($a + a$) is called "Strength Reduction." While also an optimization, it doesn't solve the redundancy problem as effectively as CSE in this specific code snippet.
Updated On: Jul 4, 2026
  • Keep both statements unchanged
  • Replace multiplication with addition
  • Compute once and reuse result
  • Remove both statements
Show Solution

The Correct Option is C

Solution and Explanation

Was this answer helpful?
0

Top Questions on Regular expressions and finite automata