Question: Ocaml program Define a function called ' f ' that takes in input one argument: a list of integers. The function ' f ' retrieves

Ocaml program
Ocaml program Define a function called ' f ' that takes in

Define a function called ' f ' that takes in input one argument: a list of integers. The function ' f ' retrieves the head of the list in input and adds it to the length of the rest of the list. Example: f[4;3;2;1]=7 because the rest of the list is [3;2;1] whose length is 3 . After the function definition of ' f, write the following function calls: print int (f [4;3;2;1]); print int (f[10;1;3;5;7;9]); Check that executing starter.ml prints ' 7 ' and ' 15 ' in this order

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!