954,506 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

what is the execution time T(n) of the 2 algorithms?

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

coffee_bean
Newbie Poster
1 post since Jan 2010
Reputation Points: 10
Solved Threads: 0
 
Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: