Consider the following pseudo-code algorithm: S:=0 for i:=1 to n for j :=1 to i S:=s+j.(i- j +1) next i next i 1. Make a
Posted: Thu May 12, 2022 2:25 pm
Consider the following pseudo-code algorithm: S:=0 for i:=1 to n for j :=1 to i S:=s+j.(i- j +1) next i next i 1. Make a table or list that calculates how many iterations of the inner for loop there are for each iteration of the outer loop. (That is, when i = 1, how many "" loops will occur? How about when i = 2? Etc.) 2. Find an expression involving n that gives the total number of operations performed by the algorithm. 3. Determine the order of this algorithm.