Question: RTC ( n ) Input: A nonnegative integer, n Output: A numerator or denominator ( depending on parity of n ) in an approximation of
RTCn
Input: A nonnegative integer, n
Output: A numerator or denominator depending on parity of n in an approximation of
If n
Return n
If n
t: RTCn
If n is odd
s: RTCn
Return s t
If n is even
r: RTCn
Return r t
If n is even
print Your approximation is RTCn RTCn
What is the output for the algorithm if the input n is
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
