From junaidsidd@usa.net  Tue Nov 21 08:15:33 2000
Received: from awcst094.netaddress.usa.net (awcst094.netaddress.usa.net [204.68.24.94])
	by swi.psy.uva.nl (8.9.3/8.9.3) with SMTP id IAA28453
	for <prolog@swi.psy.uva.nl>; Tue, 21 Nov 2000 08:15:33 +0100 (MET)
Received: (qmail 14722 invoked by uid 60001); 21 Nov 2000 07:15:33 -0000
Message-ID: <20001121071533.14721.qmail@awcst094.netaddress.usa.net>
Received: from 204.68.24.94 by awcst094 for [149.99.192.234] via web-mailer(34FM.0700.4.03) on Tue Nov 21 07:15:33 GMT 2000
Date: 21 Nov 00 02:15:33 EST
From: j s <junaidsidd@usa.net>
To: prolog@swi.psy.uva.nl
Subject: insert and delete
X-Mailer: USANET web-mailer (34FM.0700.4.03)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by swi.psy.uva.nl id IAA28453

Hello!

Could someone tell me how can I write the following prolog predicates:

insert(Old,N,New) -- succeeds iff Old and New are well-formed BSTs containing
integers, N is a number, and New is the BST you'd get from inserting N into
Old. 

delete(Old,N,New) -- succeeds iff Old and New are well-formed BSTs containing
integers, N is a number, and New is the BST you'd get from deleting N into
Old. 

I'm representing my well-formed BSTs as follows:

          3
         / \
        1   5

node(3,node(1,empty,empty),node(5,empty,empty))

(analogous to node(V,L,R) where V is the value at the root, L is the left
subtree, and R is the right subtree). 


____________________________________________________________________
Get free email and a permanent address at http://www.amexmail.com/?A=1

