We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c2ca86a + 2b0b5e0 commit 3a7b50aCopy full SHA for 3a7b50a
com/williamfiset/datastructures/dynamicarray/DynamicArray.java
@@ -49,7 +49,7 @@ public void add(T elem) {
49
50
// Removes an element at the specified index in this array.
51
public T removeAt(int rm_index) {
52
- if (rm_index >= len && rm_index < 0) throw new IndexOutOfBoundsException();
+ if (rm_index >= len || rm_index < 0) throw new IndexOutOfBoundsException();
53
T data = arr[rm_index];
54
T[] new_arr = (T[]) new Object[len-1];
55
for (int i = 0, j = 0; i < len; i++, j++)
0 commit comments