Advertisement
Guest User

Untitled

a guest
Oct 13th, 2018
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/I 0.40 KB | None | 0 0
  1. %alinea 11
  2. produto_arvore(Elemento,Arvore):-
  3.     findall(X,componente(Elemento,X,_),L),
  4.     semiArvore(L,L1),not(L1==[]),append([Elemento|[L1]],[],Arvore),!;
  5.     append([Elemento],[],Arvore),!.
  6.  
  7. semiArvore([],[]).
  8. semiArvore([H|T],Arvore):-
  9.     findall(X,componente(H,X,_),L), semiArvore(L,L1), not(L1==[]),
  10.     semiArvore(T,L2), append([H|[L1]],L2,Arvore); semiArvore(T,L2), append([H],L2,Arvore).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement