Write an Elixir program that contains a module called Hw.Lists , with the following functions: 1.- swapper: Takes a list

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Write an Elixir program that contains a module called Hw.Lists , with the following functions: 1.- swapper: Takes a list

Post by answerhappygod »

Write an Elixir program that contains a modulecalled Hw.Lists , with the followingfunctions:
1.- swapper: Takes a list, and two elements Aand B as arguments. It will return a new list with any appearanceof A substituted for B, and vice versa. Any other elements are keptin the same place
2.- invert_pairs: Takes a list of tuples asargument. All tuples must have only two elements. Returns a newlist of tuples, where each tuple has the elements in inverseorder:
3.- deep_reverse: Takes a list asarguments. The list may contain nested lists. It will returnanother list, where the elements are in reverse order. The elementsin any nested list must also reverse their order. You can NOT usethe built in function for reverse:
4.- mean: Takes a list of numbers as argument.Computes the average of its values, as the sum of all of themdivided by the number of elements in the list
5.- std_dev: Takes a list of numbers asargument. Computes the standard deviation, using the followingformula:
Write An Elixir Program That Contains A Module Called Hw Lists With The Following Functions 1 Swapper Takes A List 1
Write An Elixir Program That Contains A Module Called Hw Lists With The Following Functions 1 Swapper Takes A List 1 (4.09 KiB) Viewed 37 times
***You can create any additional functions to help insolving the problems. However, you can NOT use built in functionsthat already perform the same task.***
σ=N∑(xi​−μ)2​​
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply