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
Get step-by-step solutions from verified subject matter experts
