Question: Write an Oz program which returns the first element of a list and the last element of that list. For example, if the input is

Write an Oz program which returns the first element of a list and the last element of that list. For example, if the input is [2 ~5 3 ~1 6 ~3 9 4], the output should be 2#4, if the input is[4 ~2], the output should be4#~2, and if the input is [2], the output should be 2#2. 

Step by Step Solution

3.38 Rating (139 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres an Oz program that implements the desired functionality oz declare fun FirstLast L case ... View full answer

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 Operating System Questions!