Question: Can somebody help me please Select a theta notation from among Theta(lg n), Theta(n), Theta(n lg n), Theta(n^k), Theta(2^n), Theta(n!) for the number of times

Can somebody help me please  Can somebody help me please Select a theta notation from among

Select a theta notation from among Theta(lg n), Theta(n), Theta(n lg n), Theta(n^k), Theta(2^n), Theta(n!) for the number of times the statement x:=x+1 is executed in x:=0 for i:=1 to 2n for j:= 1 to 2i+1 x:=x+1 Solution. For each I = 1, 2, 3, ..., 2n the inside for loop is executed once which involves 2i + 1 executions of x:= x + 1. Hence the total number of executions of x:= x +1 is Sigma_i=1^2n (2i + 1) = Sigma_i=1^2n 2i + Sigma_i=1^2n 1 = 2 Sigma_i=1^2n i + 2n = 2(2n + 1)2n/2 + 2n = 4n^2 + 4n = theta(n^2)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!