The minimum price so far M inP SoF ar = min0 j i A[j]. Write
Fantastic news! We've Found the answer you've been seeking!
Question:
The minimum price so far M inP SoF ar = min0 ≤ j ≤ i A[j]. Write pseudocode that finds M inP SoF ar recursively. • The “current profit” CurrentP rof it = A[i] − M inP SoF ar if you purchase at the minimum price so far and sell at price A[i]. • Write pseudocode that finds the “maximum profit so far” recursively based on CurrentP rof it. Here, the maximum profit so far is the maximum profit that can be obtained if you purchase and sell by time i.
Related Book For
Microeconomics
ISBN: 978-1464187025
2nd edition
Authors: Austan Goolsbee, Steven Levitt, Chad Syverson
Posted Date: