Skip to content

Commit

Permalink
fixed comparison bug in removeAt method
Browse files Browse the repository at this point in the history
  • Loading branch information
navedrizvi committed May 15, 2019
1 parent c2ca86a commit 2b0b5e0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void add(T elem) {

// Removes an element at the specified index in this array.
public T removeAt(int rm_index) {
if (rm_index >= len && rm_index < 0) throw new IndexOutOfBoundsException();
if (rm_index >= len || rm_index < 0) throw new IndexOutOfBoundsException();
T data = arr[rm_index];
T[] new_arr = (T[]) new Object[len-1];
for (int i = 0, j = 0; i < len; i++, j++)
Expand Down

0 comments on commit 2b0b5e0

Please sign in to comment.