0
$\begingroup$

Do we have to calculate time for declaring statement, in my case int num3 statement. The following question was asked by professor as a post-lecture quiz. I selected t(n)=3, but the correct answer was t(n)=4.

What is the time taken by following algorithm on RAM model ?

enter image description here

t(n)=3
t(n)=4
t(n)=5
None of the above
$\endgroup$
2
$\begingroup$

There is no standard answer, so you'll have to go by whatever convention is used in your course.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.