Given the following pseudo code, I'm wondering if my thought process is correct when trying to determine the time complexity.
for i = 0 to n-1
Add the numbers A[0] thru A[i].
Store the result in B[i].
The algorithm will loop n times, and since the last iteration will require the most amout of computations (n computations) the algorithm will in total make n^2 + f(n) computations. where f(n) is a polynomial of degree n^2 or less. Therefore this algorithm is quadratic O(n^2).
B[i] = B[i-1]+a[i], no sane implementation would repeat the entire partial summation at each iteration. Your algorithm may beO(n^2)but prefix summation isn't.