Question: The following is an algorithm. [10] Input: Two integers A, B. Read A Read B A= A+B B= A-B A = A-B Return A, B
The following is an algorithm. [10]
Input: Two integers A, B.
Read A
Read B
A= A+B
B= A-B
A = A-B
Return A, B
What is the output of this algorithm?
How many steps does this algorithm take in terms of the size of the inputs?
How may memory units does it take in terms of the input size?
Calculate the (Big Oh) O () of the algorithm?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
