Eindoofus
asked on
What is the running time complexity of the given function?
The following question is one of the questions from an in-class homework assignment page that I don't believe we ever went over:
What is the running time complexity of the given function?
Could you please also give me a quick explanation of how this type of proplem is solved?
What is the running time complexity of the given function?
int mystry(int n) {
if ( n == 0 ) return 0 ;
return 1+ mystry(n/2) ;
}
Could you please also give me a quick explanation of how this type of proplem is solved?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
How many times do you execute the loop if n=8, 16, ... for example?