One of the lists should contain elements that will serves


This is not Python ! It is OCAML FUNCTION PROGRAMMING LANGUAGE NEED CODE IN OCAML. Please help me this thank you!

Q1. Write a function to build a dictionary from two lists of equal length. One of the lists should contain elements that will serves as keys and the other list should contain elements that will serve as values.

Run your code to demonstrate that it works. Include the output in your answer. The output should show the two starting lists and the resulting dictionary.

What happens if the lists should chance to be of unequal length?

Q2. Now write a function that will do the inverse of the operation above i.e. this function takes a dictionary and returns two lists, one list containing keys and the other list containing values.

Can you really return two independent lists (i.e. can a function return two values)? How will you resolve this problem?

Run your code to demonstrate that it works. Include the output in your answer. The output should show the starting dictionary and the two resulting lists.

Assignment Submission Instructions

Submit your work as two files:

A .ml or .caml code file (which must execute without warnings or errors)

A Microsoft Word document containing the contents of your code file (see further instructions below

Name your files as follows: YourFirstName_YourLastName_E4 (.ml or .caml, and .doc or .doctx)

In your code file, put your name, assignment name, and the date the assignment work must be submitted, at the top.

The questions and your explanations/reasoning must be included as comments in your code listing. The comments must:

Respond to any questions asked within the primary questions given above

Explain the functioning of the code segments you have written

Provide your reasoning for why you chose to write the code the way you did and if you considered any alternate ways of writing it.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: One of the lists should contain elements that will serves
Reference No:- TGS02906234

Expected delivery within 24 Hours