Arbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency
Question:
a. Give an efficient algorithm to determine whether or not there exists a sequence of currencies (Ci1, Ci2, . . ., Cik) such that R[i1, i2] · R[i2, i3] R[ik-1, ik] · R[ik, i1] > 1. Analyze the running time of your algorithm.
b. Give an efficient algorithm to print out such a sequence if one exists. Analyze the running time of your algorithm.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Question Posted: