shabaNAMINATA6 shabaNAMINATA6
  • 06-11-2020
  • Business
contestada

Create your own buy and sell stock problem

Respuesta :

brachac77
brachac77 brachac77
  • 06-11-2020

Answer:

The cost of a stock on each day is given in an array, find the max profit that you can make by buying and selling in those days. For example, if the given array is {100, 180, 260, 310, 40, 535, 695}, the maximum profit can earned by buying on day 0, selling on day 3. Again buy on day 4 and sell on day 6. If the given array of prices is sorted in decreasing order, then profit cannot be earned at all.

Explanation:

Answer Link

Otras preguntas

Put these numbers in orden from greatest to least. 1, 14/35, 7/14, -12/15
True Or False. (And explain why) If you have a sporting event coming up....to prevent over perspiration that may hinder your performance.... do NOT drink any li
define excretion in plants​
Which expression is equivalent to 2.2 - 2.5
Which characteristic is common to all prokaryotes and eukaryotes
Why did the Roanoke colony disappear
What is the mood of the following excerpt? “Walking on tiptoe and shading the candle, they went first to the dining room. There wasn’t a stick of furniture to b
How did regional geography influence the economic development of the original thirteen colonies?
Find the additive inverse of each number. 15
What is the period of coverage for events such as death or divorce under COBRA?