Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: rukman
  • Order by date
  1. rukman

    Write Prolog code which will perform a postorder traversal

    tree constant. Hint: you might use 'univ', or its cousins. ?- postorder(a(b,c,d(e,f,g))). b c e f g d a true Hi , I am trying this problem but , the output is undefined predicate postorder. I think i wrote correctly but, it is not working. postorder(void,[])...
  2. rukman

    Create a binary predicate called 'square' which will square each

    Hey ductiletoaster how did u try ? did u check whether the element is integer or not.
  3. rukman

    Write a predicate 'everyother' which will remove every other element .

    Write a predicate 'everyother' which will remove every other element in a list, starting with the second element. List length can be odd or even. e.g. ?- everyother([g,r,o,u,l,l,o,e,r,s,p],L). L = [g,o,l,o,r,p]; i am trying like this remove([_,_],[]). remove([H,H|T],R):-...
  4. rukman

    Write a predicate 'addbubba' which will place 'bubba' after each atom

    e.g. ?-addbubba([a,b,c],X). X=[a,bubba,b,bubba,c,bubba] I tried like this.. addbubba([],[]). addbubba([X|Y],[A|B]):- not(integer(X)), isList(Y),A = X,addbubba(Y,B),append(B,'bubba',K). pls help its urgent...
  5. rukman

    Create a binary predicate called 'square' which will square each

    Create a binary predicate called 'square' which will square each number in a list. This pred. will be shallow. e.g. ?-square([a,[[3]],b,4,c(5),8],X). X=[a,[[3]],b,16,c(5),64] Need help.

Part and Inventory Search

Back
Top