Can someone show how to do recursive function by hand not complier.
thank
Length of list is:
0 if the list is empty
1 (for the first element in the list) + Length of remainder of list
So length of () is 0
Length if (hello) =
1 + length of () =
1 + 0 =
1
Length of (hello friend, come with us) =
1 + length of (friend, come with us) =
1 + 1 + length of (come with us) =
1 + 1 + 1 + length of (with us) =
1 + 1 + 1 + 1 + (us) =
1 + 1 + 1 + 1 + 1 + length of () =
1 + 1 + 1 + 1 + 1 + 0 =
5
Hope this helps.
lol. One question about String,
when it say s2.replace (3,2 s1);
i know that 3 is move 3 place and what 2?
Last edited on