Question: Easy Haskell coding question 1. Write a recursive method to compute m(i) = 1 + 1/2 + 1/3, ... + 1/i, where i is an

Easy Haskell coding question

1. Write a recursive method to compute m(i) = 1 + 1/2 + 1/3, ... + 1/i, where i is an Int

2. Write a recursive method to compute m(i) = 1/2, 2/3, ... i/(i + 1), where i is an Int

3. Using recursion, implement a method that removes the max element from a list of Ints, or one of the max elements if there is more than one. E.g., [1,2,3,3,4] should become [1,2,3,4]

4. Implement a sorting algorithm that finds the max, puts it at the end of the list, then recursively sorts the remainder of the list. You can create/use any helper functions you need, provide that you wrote it yourself, or it's built into Haskell.

Please use computer to write the code.

Include type definitions for all functions.

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!