recategorized by
381 views
1 votes
1 votes
Consider the funciton $M$ defined as follows:

$M(n) = \begin{cases} n-10 & \text{ if } n > 100 \\ M(M(n+11)) & \text{ if } n \leq 100 \end{cases}$

Give a constant time algorithm that computes $M(n)$ on input $n$. (A constant-time algorithm is one whose running time is independent of the input $n$)
recategorized by

1 Answer

Related questions

1 votes
1 votes
2 answers
1
go_editor asked Dec 31, 2016
518 views
Consider the funciton $M$ defined as follows:$M(n) = \begin{cases} n-10 & \text{ if } n 100 \\ M(M(n+11)) & \text{ if } n \leq 100 \end{cases}$Compute the following$: M(...
0 votes
0 votes
1 answer
2
go_editor asked Dec 31, 2016
481 views
Consider the funciton $M$ defined as follows:$M(n) = \begin{cases} n-10 & \text{ if } n 100 \\ M(M(n+11)) & \text{ if } n \leq 100 \end{cases}$Compute the following$: M(...
2 votes
2 votes
2 answers
3
go_editor asked Dec 31, 2016
458 views
Consider the funciton $M$ defined as follows:$M(n) = \begin{cases} n-10 & \text{ if } n 100 \\ M(M(n+11)) & \text{ if } n \leq 100 \end{cases}$Compute the following$: M(...