The error message "too many levels of recursion" is sometimes misleading. In the problem below, the error source was an undefined list variable. This hint may help to find programming errors. > restart; > #=============================== > EE := proc(n1,n2) > #=============================== > global N; > # create list of nodes N > if not has(N,n1) then > N:=[op(N),n1]; > end if; > if not has(N,n2) then > N:=[op(N),n2]; > end if; > end proc: > #=============================== > EE(a,b); #N is undefined->recursion error? > N:=[]; > EE(a,b); #N is defined empty->no error Error, (in EE) too many levels of recursion N := [ ] [a, b]

Please Wait...