Skip to content

Commit 16b5843

Browse files
committed
DynamicArray: add isEmpty() method
1 parent e300d8b commit 16b5843

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/main/lists/DynamicArray.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ public int getCapacity() {
3535
return this.array.length;
3636
}
3737

38+
public boolean isEmpty() {
39+
return this.length == 0;
40+
}
41+
3842
public DynamicArray<T> shrinkCapacity() {
3943
Object[] newArray = new Object[this.length];
4044

0 commit comments

Comments
 (0)