This is a library that allows one to calculate the max possible profit from an array of time ordered stock prices.
- 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.
Binary Search Tree