Question: The integer constant C = 681; work out the total number, T(n), of elementary operations, excluding the loop and branch control, performed for an integer
The integer constant C = 681; work out the total number, T(n), of elementary operations, excluding the loop and branch control, performed for an integer n = 3v; v 2, by a pseudocode below, and give its Big-Theta time complexity bound:
for i = 1 step i i + 1 while i n do
if i 2 OR i n - 2
for j = n step j j - 1 while j > 0 do
Constant number C of elementary operations
end for
else
for j = n step j j/3 while j > 1 do
Constant number C of elementary operations
end for
end if
end for
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
