Find two contiguous subarrays with the greatest difference
Because the two subarrays are disjoint, there exists at least one index $m$ such that one entire subarray lies $\leq m$ and the other subarray lies $\gt m$.

But we do not know what this $m$ is, beforehand. So let us iterate over all the $n$ possibilities for $m$. Now if an $m$ is fixed, then the problem reduces to the Maximum subarray problem, and the Minimum subarray problem. This is because for the absolute difference to be the largest, one side of $m$ should have the maximum possible subarray, and the other side should have the minimum possible subarray. So we try both of these options and take the maximum absolute difference among the two.

But this is still $\mathcal{O}(n^2)$, because there are $n$ different values of $m$, and for each of those values, we have to spend $\mathcal{O}(n)$ time to compute the needed minimum and maximum subarrays.

The next observation is to note that a single $\mathcal{O}(n)$ run of the Maximum subarray algorithm on the entire array can actually give us one of the needed values for all values of $m$: 

Given: int A[n]

MaxSubarrayTill[0] = A[0]
MaxSubarrayEndingAt[0] = A[0]
for(i = 1; i &lt; n ; i++)
{
    MaxSubarrayEndingAt[i] = max{A[i], MaxSubarrayEndingAt[i - 1] + A[i]}
    MaxSubarrayTill[i] = max{MaxSubarrayTill[i - 1], MaxSubarrayEndingAt[i]}
}


Here, $\text{MaxSubarrayTill}[i]$ denotes the maximum sum subarray which ends $\le i$, and $\text{MaxSubarrayEndingAt}[i]$ denotes the maximum sum subarray which ends at index $i$.

Similarly, we can compute the $\text{MinSubarrayTill}[i]$ array in $\mathcal{O}(n)$ time. And by repeating the same two algorithms in reverse (ie. from the end of the array to the beginning), we can get $\text{MaxSubarrayFrom}[i]$ and $\text{MinSubarrayFrom}[i]$.

So in $\mathcal{O}(n)$ time we have precomputed all the values that we needed in the first algorithm, which we can now go back to. Interate over all the values of $m$, and find the largest absolute difference in $\mathcal{O}(n)$ time.

If the problem also stipulates that the two subarrays should be adjacent, then we can leave out $\text{MaxSubarrayTill}[i]$ and its analogous arrays, and instead only consider $\text{MaxSubarrayEndingAt}[i]$ and its analogous three other arrays. The rest of the algorthm remains the same.