Question: Please answer using the OZ Programming Language: Write a function {Position Xs Y} that returns the first position of Y in the list Xs. The

Please answer using the OZ Programming Language:

Write a function {Position Xs Y} that returns the first position of Y in the list Xs. The positions in a list start with 1. For example, {Position [a b c] c} returns 3 and {Position [a b c b] b} returns 2. Try two versions:

1) one that assumes that Y is an element of Xs and

2) one that returns 0, if Y does not occur in Xs.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!