对于广义表L=(a,(b,c),((d),e)),下列操作中,结果为原子'c'的是:
答案解析
要得到原子'c',需要逐步分析广义表的操作。首先L=(a,(b,c),((d),e))。tail(L) = ((b,c),((d),e)); head(tail(L)) = (b,c);tail(head(tail(L))) = (c);head(tail(head(tail(L)))) = c。因此选项A正确。对于选项B,tail(head(L))=( ),所以tail(tail(head(L)))操作非法;对于选项C,tail(tail(L)) = (((d),e)),head(tail(tail(L))) = ((d),e), tail(((d),e)) = (e),head((e)) = e,所以选项C错误;对于选项D,head(L) = a, tail(head(L)) 操作非法,所以选项D错误。
正确答案:A