Problem: Algorithm
You are asked to design an algorithm to optimize profit on a stock X. The following is how the stock has been doing for the last 10 days:
Day 1: $143;
Day 2: $122;
Day 3: $121;
Day 4: $119;
Day 5: $147;
Day 6: $170;
Day 7: $172;
Day 8: $180;
Day 9: $170;
Day 10: $161.
Your algorithm should:
• Find the lowest price to buy and the highest price to sell.
• Make the buying date before the selling date.
The response must include a reference list. Using Times New Roman 12 pnt font, double-space, one-inch margins, and APA style of writing and citations.