Can someone explain this to me?
Such as this:
Given a function:
for k = 1 to lg(n) for j = 1 to n x=x+1
How would I analyze the tight (Θ) bound?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your function is Θ(log n · n): The outer loop is repeated log n times and the inner loop n times (for each iteration of the outer
for), sox=x+1is executed log n · n times in total. And since the number of repetitions is fixed, the lower and upper bound is the same.