项目作者: sanderhelleso

项目描述 :
Each day the stock price fluctuates during the day. Given an array of stock prices, what would be the most efficient way to determine the best time to buy and sell to get the max profit. You must buy before you sell.
高级语言: Java
项目地址: git://github.com/sanderhelleso/maxProfitStockMarket.git
创建时间: 2018-10-15T01:52:10Z
项目社区:https://github.com/sanderhelleso/maxProfitStockMarket

开源协议:

下载


maxProfitStockMarket


  1. Each day the stock price fluctuates during the day.
  2. Given an array of stock prices, what would be the most
  3. efficient way to determine the best time to buy and sell
  4. to get the max profit. You must buy before you sell.
  5. Examples:
  6. --------------------------------------------------------------------------
  7. maxProfit( [ 1, 3, 5, 4, 3, 5, 10, 9, 8, 4, 9]) -> buy at 1, sell at 10
  8. maxProfit( [ 2 , 3, 1, 5, 6, 9, 10, 15 14 ]) -> buy at 1, sell at 15
  9. maxProfit( [ 15, 12, 11, 9, 7, 5, 3, 1] ) -> no profit is possible


Program Overview


app img 1
app img 2



Program Description

  1. This application reads an array of generated data of user defined size that
  2. simulates the stock market. It then determinesthe best time to sell / buy
  3. to recieve the best potensial profit available of the data.
  4. After generating the result, the application creates a new report CSV file and filled
  5. it up with data from the calculations (id, sellValue, buyValue, sellDay, buyDay)
  6. A nice addition to this application could be to generate a chart using the freshly
  7. created CSV file to further visually display the data.