Stock Market Problem and Maximum Subarray Problem

Below is Java code that implements three different solutions for the Stock Market problem:

Below is Java code that implements a brute force and a divide-and-conquer solution for the Maximum Subarray Sum problem: