GATE CSE
First time here? Checkout the FAQ!
x
0 votes
13 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}$

Give a constant time algorithm that computes $M(n)$ on input $n$. (A contant-time algorithm is one whose running time is independent of the input $n$)
asked in Others by Veteran (79.1k points)   | 13 views

Please log in or register to answer this question.



Top Users Aug 2017
  1. Bikram

    4892 Points

  2. ABKUNDAN

    4704 Points

  3. akash.dinkar12

    3480 Points

  4. rahul sharma 5

    3158 Points

  5. manu00x

    3012 Points

  6. makhdoom ghaya

    2470 Points

  7. just_bhavana

    2382 Points

  8. stblue

    2130 Points

  9. Tesla!

    2066 Points

  10. joshi_nitish

    1758 Points


25,009 questions
32,131 answers
74,801 comments
30,179 users