/
IntList.java
53 lines (46 loc) · 1.13 KB
/
IntList.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.gradescope.intlist;
import com.gradescope.intlist.AbstractIntList;
public class IntList extends AbstractIntList{
/**
* Calls the parent constructor
*/
public IntList(int head){
super(head);
}
/**
* This copy constructor is needed for test cases; do not touch
*/
public IntList(AbstractIntList list){
this(list.head);
if(list.next != null){
this.next = new IntList(list.next);
}
}
/**
* Creates an IntList from a variable number of arguments
*/
public static AbstractIntList createList(int... a){
// TODO: Fill me in!
}
/**
* Appends value to the end of the list
*/
public AbstractIntList append(int value){
// TODO: Fill me in!
}
/**
* Returns true if the IntList contains the value
*/
public boolean contains(int value){
// TODO: Fill me in!
}
/**
* Converts an IntList to a string.
*
* The last element should be
* followed by a newline instead of a space.
*/
public String toString(){
// TODO: FIll me in!
}
}