Pankaj and Mythili were both asked to write the code to evaluate the following expression:
$$a - b + c/(a-b) + (a-b)^2 $$
Pankaj writes the following code statements (Code A):
print (a-b) + c/(a-b) + (a-b)*(a-b)
Mythili writes the following code statements (Code B):
d = (a-b)
print d + c/d + d*d
If the time taken to load a value in a variable, for addition, multiplication or division between two operands is same, which of the following is true?
- Code A uses lesser memory and is slower than Code B
- Code A uses lesser memory and is faster than Code B
- Code A uses more memory and is faster than Code B
- Code A uses more memory and is slower than Code B