Skip to content
Related Articles

Related Articles

UGC-NET | UGC NET CS 2016 Aug – II | Question 33
  • Last Updated : 06 Feb, 2020
GeeksforGeeks - Summer Carnival Banner

In compiler optimization, operator strength reduction uses mathematical identities to replace slow math operations with faster operations. Which of the following code replacements is an illustration of operator strength reduction ?
(A) Replace P + P by 2 * P or Replace 3 + 4 by 7.
(B) Replace P * 32 by P < < 5
(C) Replace P * 0 by 0
(D) Replace (P < <4) – P by P * 15

Answer: (B)

Explanation: In option (B), Multiplication operation is replaced with Shift Operator . It reduce the operator strength because shift operator is less expensive than multiplication operation.

So option (B) is correct.

Quiz of this Question

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :