Question #177743

Write an algorithm that takes the positive integer ‘n’ as input and returns the exponent 2^n as output. Analyze the time complexity of the algorithm using program step table method.


Expert's answer

n=input("Enter positive integer")
b=n^2
print(b)

Find time complexity:


O(n)=3O(n)=3

because the algorithm has three steps.




Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS