d) The map and reduce functions are part of the functional programming paradigm and are widely used in non-functional languages as well. To understand the power of the map/reduce combination, use the code written in parts a)-c)) to implement the following in a the main() function of class MRExample: - create a MyList object ls with several nonempty String objects added to it - use function ls.map() to return the list of Integer objects representing the length of each string in ls. Use the LengthFun functor class. Call the returned list a variable li. - Use li.reduce() with a Summer object to compute the total number of characters in all strings in the ls list.

Solved
Show answers

Ask an AI advisor a question