()略
()求广义表原子个数的递归模型如下
f(p)=
PROC Number(p:glist; VAR n: integer)
VAR m:integer;
n:=;
IF p<>NIL THEN
[IF p^tag= THEN n:= ELSE Number(p^sublistm)
n:=n+m; Number(p^linkm); n:=n+m; ]
ENDP;
int Count(glist *gl)
//求广义表原子结点数据域之和原子结点数据域定义为整型
{if(gl==null) return();
else if (gl>tag==) return((p>data)+count(gl>link));
else return(count(gl>sublist)+count(gl>link)); }
}// Count
[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []