1.

Answer plsThis is so hard pls help #beginerr

Answer»

Step-by-step EXPLANATION:

you have to find the value of f(n)

so that put value of n=1,2,3,4 upto n

whenever you put!n = even(2,4,6,8.....) you have to USE n/2 for finding f(n)

whenever you put n =odd(1,3,5,....) you have to use 3n+1 for finding f(n)

put n= 1 => f(n) = 3(1) + 1=4

n=2 => f(2) = 2/2 = 1

n=3 => f(3) = 3(3) + 1 =10

n=4 => f(4) = 4/2 = 2

& so on....



Discussion

No Comment Found

Related InterviewSolutions