Write in JAVA a dive and conquer algorithm for determining the best time to purchase and the
Fantastic news! We've Found the answer you've been seeking!
Question:
Write in JAVA a dive and conquer algorithm for determining the best time to purchase and the best time to sell a stock. Assume the price of the stock vs the time is represented by the array S of integers. Compute the complexity of your algorithm.
The complexityshould be not more than (nlogn). i.e Given an array A of non-negative integers of size n. Find the two indices p and s , 0==p>=n-1>
Posted Date: