You are given an input array A with n positive elements. Each element is the value of
Fantastic news! We've Found the answer you've been seeking!
Question:
You are given an input array A with n positive elements. Each element is the value of a stock at that point (time). Assuming are given this future information you need to decide when to buy and sell the stock to make maximum profit (i.e. sell - buy).Implement, using divide and conquer, the function below which returns the maximum possible profit. Implement, using divide and conquer, the function below which returns a pair of iterators pointing to the buying/selling values respectively.
Implement the function below which returns theindicesof the buying selling values, given:
1.begin=iterator to the beginning of the container (e.g. vector),
- start=iterator to buying element
- end=iterator to selling element
#include #include #include #include #include stock.h\" v:shapes=\"Picture_x0020_44\">
Posted Date: