Question: 8. In Prolog, binary trees can be constructed using the following functors: nil/0 t/3 in the textbook, t is used in the form: t(L,X,R) For

8. In Prolog, binary trees can be constructed using the following functors: nil/0 t/3 in the textbook, t is used in the form: t(L,X,R) For example, the tree: Il 3 8 II 1 4 11 ... is represented as: t(t (t (nil,1,nil),3, t (nil,4, nil)),5, t(nil,8, t(nil,11, nil))) Note: the above is actually a binary search tree (BST). Define a relation in_BST (X,T) for all pairs where element X occurs in BST T. You may assume that T is a BST
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
