Difference between revisions of "ImmutableList Assignment"
Jump to navigation
Jump to search
(→Length) |
|||
Line 1: | Line 1: | ||
=Code To Implement= | =Code To Implement= | ||
− | |||
==Length== | ==Length== | ||
{{JavaToImplement|Length|length|util.assignment}} | {{JavaToImplement|Length|length|util.assignment}} | ||
<nowiki>public static <E> int length(ImmutableList<E> list)</nowiki> | <nowiki>public static <E> int length(ImmutableList<E> list)</nowiki> | ||
+ | |||
+ | ==SumProductCountdownFactorial== | ||
+ | {{JavaToImplement|SumProductCountdownFactorial|sum<br/>product<br/>countdown<br/>factorial|util.assignment}} | ||
+ | |||
+ | ==sum== | ||
+ | <nowiki>public static int sum(ImmutableList<Integer> xs)</nowiki> | ||
+ | |||
+ | ==product== | ||
+ | <nowiki>public static int product(ImmutableList<Integer> xs)</nowiki> | ||
+ | |||
+ | ==countdown== | ||
+ | <nowiki>public static ImmutableList<Integer> countdown(int n)</nowiki> | ||
+ | |||
+ | ==factorial== | ||
+ | <nowiki>public static int factorial(int n)</nowiki> | ||
==Append== | ==Append== | ||
{{JavaToImplement|Append|append|util.assignment}} | {{JavaToImplement|Append|append|util.assignment}} | ||
− | + | <nowiki>public static <E> ImmutableList<E> append(ImmutableList<E> xs, ImmutableList<E> ys)</nowiki> | |
− | |||
=Test= | =Test= | ||
java/src/test/java/util/assignment/ImmutableListTestSuite.java | java/src/test/java/util/assignment/ImmutableListTestSuite.java |
Revision as of 15:02, 11 June 2019
Contents
Code To Implement
Length
class: | Length.java | ![]() |
methods: | length | |
package: | util.assignment | |
source folder: | src/main/java |
public static <E> int length(ImmutableList<E> list)
SumProductCountdownFactorial
class: | SumProductCountdownFactorial.java | ![]() |
methods: | sum product countdown factorial |
|
package: | util.assignment | |
source folder: | src/main/java |
sum
public static int sum(ImmutableList<Integer> xs)
product
public static int product(ImmutableList<Integer> xs)
countdown
public static ImmutableList<Integer> countdown(int n)
factorial
public static int factorial(int n)
Append
class: | Append.java | ![]() |
methods: | append | |
package: | util.assignment | |
source folder: | src/main/java |
public static <E> ImmutableList<E> append(ImmutableList<E> xs, ImmutableList<E> ys)
Test
java/src/test/java/util/assignment/ImmutableListTestSuite.java