Stock Max Profit

Description

This is a library that allows one to calculate the max possible profit from an array of time ordered stock prices.

Use

  • Firstly import the module -->
let maxSpread = require('./maxSpread');
  • And now simply pass the array with the data to the maxSpread() function you imported from the module.
  • Implemented as an anonymous function to preserve simplicity.

Implemented algorithms

Binary Search Tree

Check Example Imprementation, feel free to test the code.