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

None of the above

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


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.