Java 8 find array of countup sums
Am I correct in saying this solution is O(nlog(n))?


Proof

Whenever there are nested loops,the complexity is measured by number of times inner most loop get executed.
Example

for (i = 1; i &lt;=n; i ++) {
   for (j = 1; j &lt;=i; j ++) {
      // some O(1) expressions
}


inner loop executed=1+2+3+4+...n=(n*(n+1))/2≈ n2.
Hence time complexity is O(n2).  

In your case the inner loop is executed 2+3+4+..+n times≈n2.

Hence time complexity of your solution is  O(n2)

Your first approach in Java 7 can be improved by eliminating the inner loop.
Here is an approach which uses only one loop.

    array[1]=array[0]+array[1];
    int sum=array[0];
    int length=array.length;
    for(int i=2;i&lt;length;i++)
    {
        array[i]+=array[i-1]+sum;
        sum+=array[i-1];//storing the sum up to i-1;
    }


Improvement


Eliminated the inner loop.
Added a new variable sum which keeps the summation of the numbers up to index i-2 when calculating array[i].
Time Complexity reduced from O(n2) to O(n).


Hope this helps.