Happy new year and peace to you all! Can you please explain to me what is the execution time T(n) of the 2 algorithms?
Algorithm 1: for i ← 1 to n do for j ← 1 to i do for k ← j to i+j do a ← a + 1
Algorithm 2: for i ← 1 to n do for j ← 1 to i^2 do for k ← 1 to j do a ← a + 1
http://www.seas.upenn.edu/~chinawat/teaching/2007c/lab03sup.pdf Found with 5-seconds of google.