Question: Given two numbers X and Y in the computer memory. Exchange/swap these two units of memory, i.e., get Y and X without using any extra
Given two numbers X and Y in the computer memory. Exchange/swap these two units of memory, i.e., get Y and X without using any extra memory.
E.g. you can use X = X+Y, but you cannot use Z= X since Z is forbidden
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
