GATE CSE
First time here? Checkout the FAQ!
x
0 votes
9 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 (76.3k points)   | 9 views

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.


Top Users Apr 2017
  1. akash.dinkar12

    3660 Points

  2. Divya Bharti

    2576 Points

  3. Deepthi_ts

    2040 Points

  4. rude

    1966 Points

  5. Tesla!

    1768 Points

  6. Debashish Deka

    1614 Points

  7. Shubham Sharma 2

    1610 Points

  8. Arunav Khare

    1464 Points

  9. Arjun

    1440 Points

  10. Kapil

    1426 Points

Monthly Topper: Rs. 500 gift card

22,084 questions
28,059 answers
63,275 comments
24,158 users