Question: ` ` ` def f [ X ] ( xs:List [ X ] , Ys:List [ X ] ) : List [ X ] =
def f Xxs:ListX Ys:ListX : ListX
xs match
case Nil mys
case z :s zs mf zs z :: ys
def g Xxs:ListX ys:ListX n:Int : ListX
def gas:ListX : ListX
as match
case Nil if n then gys else Nil
case z :s zs mp@subsupgtextrmzs
gxs
def h Xxs:ListX n:Int : ListX
if nmathrm then
xs
else
val ys h xs n
ys ::: ys
def k Xxs:ListX ys:ListX zs:ListX : ListX
xs match
case Nil zs
case a :: as ys as a :: zs
Which of the statements are true:
f is tailrecursive mathrmgmathrm~h and k are not tail recursive
g and h are tailrecursive f and k are not tail recursive
f and k are tailrecursive g and h are not tail recursive
g is tailrecursive mathrmfmathrmh and k are not tail recursive
f g and k are tailrecursive h is not tail recursive
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
