add solutions for hw6:Base
All checks were successful
Fast Reverse Tests / test (push) Successful in 24s
Reverse Tests / test (push) Successful in 8s
Sum Tests / test (push) Successful in 9s
Word Stat Tests / test (push) Successful in 8s

This commit is contained in:
2026-02-02 13:25:10 +05:00
parent 1e5c8fab61
commit 380611c4df
3 changed files with 155 additions and 0 deletions

28
java/wspp/IntList.java Normal file
View File

@@ -0,0 +1,28 @@
package wspp;
public class IntList {
private int[] array;
private int size;
public IntList() {
array = new int[10];
size = 0;
}
public void add(int value) {
if (size >= array.length) {
int[] newArray = new int[array.length * 2];
System.arraycopy(array, 0, newArray, 0, size);
array = newArray;
}
array[size++] = value;
}
public int get(int index) {
return array[index];
}
public int size() {
return size;
}
}