753 views

A language with string manipulation facilities uses the following operations

head(s): first character of a string
tail(s): all but exclude the first character of a string
concat(s1, s2): s1s2

For the string "$acbc$" what will be the output of

concat(head(s), head(tail(tail(s))))
1. $ac$
2. $bc$
3. $ab$
4. $cc$
edited | 753 views
0
i think some correction is required in question
tail(s): all but the EXCLUDE first character of a string

$concat(a,head(tail(tail(acbc))))$

$concat(a,head(tail(cbc)))$

$concat(a,head(bc))$

$concat(a,b)$

$ab$.

edited
0
0

@altamash no answer will be  ab

use the tail definition which is given in the question

1
2