| Package | Description |
|---|---|
| list |
| Modifier and Type | Method and Description |
|---|---|
static IntList |
IntList.dupList(int size,
int data)
Like zeros and ones, but the caller chooses the initial value.
For example, dupList(5, 2) should return the list [2, 2, 2, 2, 2] |
static IntList |
IntList.ones(int size)
Create a new list with each entry initialized to one.
|
IntList |
IntList.plus(IntList other)
Compute the entry-wise sum of the current list with another list.
For example, adding the lists [0, 1, 2, 3] [1, 5, 5, 3] Should return the list [1, 6, 7, 6] You can do this with a call to the constructor, followed by a loop with calls to get() and prepend(). |
IntList |
IntList.prepend(int data)
Inserts a new entry at the front of this list.
For example, if myList is [1, 2, 5, 3] after calling myList.prepend(10), myList will have changed to [10, 1, 2, 5, 3] |
static IntList |
IntList.range(int start,
int stop)
Create a new list with each entries in the specified range
For example, input parameters start = 3, stop = 7 should return [3, 4, 5, 6, 7] |
static IntList |
IntList.zeros(int size)
Create a new list with each entry initialized to zero.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
IntList.equals(IntList other)
Returns true if this list is identical to some other list.
The lists must be non-null, the same size, and contain identical values at each index. |
IntList |
IntList.plus(IntList other)
Compute the entry-wise sum of the current list with another list.
For example, adding the lists [0, 1, 2, 3] [1, 5, 5, 3] Should return the list [1, 6, 7, 6] You can do this with a call to the constructor, followed by a loop with calls to get() and prepend(). |