Trees binary

Description

Defining binary trees.

Source: The Art of Prolog

Download

Program source code: trees_binary.pl

Listing

/*
	binary_tree(Tree) :- Tree is a binary tree.
*/
	binary_tree(void).
	binary_tree(tree(Element,Left,Right)) :-
		binary_tree(Left), binary_tree(Right).
 
%	Program 3.23: Defining binary trees

Comments

pl/prolog/pllib/trees_binary.txt · ostatnio zmienione: 2017/07/17 08:08 (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