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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.