Given the following pseudo code, I am supposed to find out how many times the statement in the innermost loop is executed, as a function of n, and what the best and worst case scenarios of order of operations of this algorithm is.
Algorithm What(A,n)
A <-- new 2D array of n*n integers
s <-- 0
for I <-- 2 to n-2 do
for j <-- I-2 to n-1 do
s <--s + A[I][j]
end for
end for
I am just having trouble with conceptualizing how to figure this stuff out. Any help would be greatly appreciated :)