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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started