QuickTopic (SM) free message boards QuickTopic (SM) free message boards
Skip to Messages
  Sign In to access your topic list  |New Topic |My Topics|Profile
Upgrade to Pro   Customize, show pictures, add an intro, and more:   QuickTopic Pro...and check out QuickThreadSM
Topic: CSE 130 Homework #8
Views: 1494, Unique: 596 
Subscribers: 0
What's
this?
Printer-Friendly Page
Subscribe to get & post, or stop messages by email Subscribe
All messages    << 17-29  16-16 of 29  1-15 >>
About these ads
Who | When
Messagessort recent-bottom   
Post a new message
 
Sean O'RourkePerson was signed in when posted  16
03-04-2004 09:17 AM ET (US)
Shaniqua -- that is a correct example.

Omid -- remember that you can have a variable as part of a complex expression in prolog, so e.g.
    [1,A,2|B]
means "a list consisting of '1', then something, then '2', then zero or more elements".

For part 3, it should be _easier_ to write BSTs in prolog ;). The general idea when doing data structures without assignment is to (conceptually) create a whole new copy with the necessary changes. In prolog, this looks like:
    modification(OldVersion, ..., NewVersion) :- ...
i.e. a relation between the old and new versions of a data structure. Think of the recursive version of binary tree insertion, and try to formulate that as clauses of a relation.

autumn -- if it can't satisfy the relation, it will print out "no". If it can, it will print out a list of variable bindings, then a "?" to ask if you want more solutions. Just press enter. It should then print out "yes".
RSS link What's this?
All messages    << 17-29  16-16 of 29  1-15 >>
QuickTopicSM message boards
Over 200,000 topics served
Learn more Frequently asked questions  Acknowledgements
What they're saying about QuickTopic
 Questions, comments, or suggestions? Contact Us
Read our use policy before beginning. We value your privacy; please read our privacy statement.
Copyright ©1999-2008 Internicity Inc. All rights reserved.