Różnice

Różnice między wybraną wersją a wersją aktualną.

Odnośnik do tego porównania

pl:prolog:pllib:trees_isomorphic [2019/06/27 15:50] (aktualna)
Linia 1: Linia 1:
 +====== Trees isomorphic ======
 +{{tag>​trees}}
 +===== Description =====
 +Determining when trees are isomorphic.
 +
 +**Source**: ​ The Art of Prolog
 +===== Download =====
 +Program source code: {{trees_isomorphic.pl}}
 +===== Listing =====
 +<code prolog>
 +/*
 + isotree(Tree1,​Tree2) :- 
 + Tree1 and Tree2 are isomorphic binary trees
 +*/
 + isotree(void,​void).
 + isotree(tree(X,​Left1,​Right1),​tree(X,​Left2,​Right2)) :- 
 + isotree(Left1,​Left2),​ isotree(Right1,​Right2).
 + isotree(tree(X,​Left1,​Right1),​tree(X,​Left2,​Right2)) :- 
 + isotree(Left1,​Right2),​ isotree(Right1,​Left2).
 +
 +% Program 3.25: Determining when trees are isomorphic
 +</​code>​
 +===== Comments =====
  
pl/prolog/pllib/trees_isomorphic.txt · ostatnio zmienione: 2019/06/27 15:50 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0