Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
fp:lab01-java-intro [2021/03/11 13:37] pdmatei |
fp:lab01-java-intro [2021/03/11 14:50] (current) dmihai |
||
---|---|---|---|
Line 3: | Line 3: | ||
===== 1. A single function to implement all of them ===== | ===== 1. A single function to implement all of them ===== | ||
- | 1.1. Write a method that takes a list of integers and returns a new list with all elements multiplied by two. | + | 1.1. Write a method that takes a list of **integers** and returns a new list with all elements multiplied by two. |
- | 1.2. Write a method that takes a list of doubles and returns a new list with all elements multiplied by two. | + | 1.2. Write a method that takes a list of **doubles** and returns a new list with all elements multiplied by two. |
1.3. Write a method that takes a list of integers and returns a new list with all the elements’ successors (i.e. the elements incremented by 1). | 1.3. Write a method that takes a list of integers and returns a new list with all the elements’ successors (i.e. the elements incremented by 1). | ||
Line 40: | Line 40: | ||
3.3. Write a method that takes a list of integers and returns a string representation of all elements separated by commas, e.g. “1,2,3,4” | 3.3. Write a method that takes a list of integers and returns a string representation of all elements separated by commas, e.g. “1,2,3,4” | ||
- | 3.4. Write a method that takes a list of integers and another list (of integers) and returns the concatenation of the second to the first. | + | 3.4. Write a method that takes a list of integers and returns their greatest common denominator. |
3.5. (Discussion) What is (could be!) common among all implementations? How should a ''fold'' function **signature** (which generalises over all previous ones) look like? | 3.5. (Discussion) What is (could be!) common among all implementations? How should a ''fold'' function **signature** (which generalises over all previous ones) look like? |