Question: Ocaml program Define a function called ' f ' that takes in input one argument: a list of integers. The function ' f ' retrieves
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
Get step-by-step solutions from verified subject matter experts
