Difference between revisions of "ImmutableList Assignment"
Jump to navigation
Jump to search
(→Append) |
|||
Line 23: | Line 23: | ||
==Append== | ==Append== | ||
− | {{JavaToImplement| | + | {{JavaToImplement|Concat|concat|immutable.list.apps.assignment}} |
<nowiki>public static <E> ImmutableList<E> append(ImmutableList<E> xs, ImmutableList<E> ys)</nowiki> | <nowiki>public static <E> ImmutableList<E> append(ImmutableList<E> xs, ImmutableList<E> ys)</nowiki> |
Revision as of 04:53, 17 January 2020
Contents
Code To Implement
class DefaultImmutableList implements ImmutableList<E>
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: | Concat.java | ![]() |
methods: | concat | |
package: | immutable.list.apps.assignment | |
source folder: | src/main/java |
public static <E> ImmutableList<E> append(ImmutableList<E> xs, ImmutableList<E> ys)
Test
class: | ImmutableListTestSuite.java | ![]() |
package: | util.assignment | |
source folder: | src/test/java |