the function calls itself 3 times, splits the array into left and right halves over and over until the length is 1. so it repeats depending on size of array.
My question is what order is calls itself
return(maxSubArraySum(arr, l, m),
maxSubArraySum(arr, m+1, h),
maxCrossingSum(arr, l, m, h));
I am envisioning a tree with two parent and each child is the left and right half of the left and right half of each array until the length is 1. I'm just not sure the order the compiler runs it.
-------------*1 ------------------- *2
-------- *3------*4 ----------- *5--- *6
--------*7-*8--*9*10-------*11*12--*13*14
basically will it run 1,3,7,8,4,9,10,2,5,11,12,6,13,14
or 1,2,3,4,5,6,7,8..