Question: Do not use any ML build-in library functions such as String.sub(), List.nth() Do not use @ nor L=[] Do not use 'strict' tail recursions unless

  • Do not use any ML build-in library functions such as String.sub(), List.nth()
  • Do not use @ nor L=[]
  • Do not use 'strict' tail recursions unless they are helpers
  • Your program should be well documented in a nice layout.
  1. Write a functioninseato insert an element to each position of a list. Do it in recursive fashion. Two functions (not including possible @ or app). insea(4,[1,2,3]) [[4,1,2,3],[1,4,2,3],[1,2,4,3],[1,2,3,4]]
  1. Write ahigher orderfunctionchcaseto convert input string to uppercase. You may assume the string contains only letters. chcase("ChCase") "CHCASE"
  2. Write ahigher orderfunctioninfront1to insert an element as the head of each element of a list. infront1(1,[[1,2],nil,[3]]) [[1,1,2],[1],[1,3]]

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 Programming Questions!