File tree 2 files changed +3
-5
lines changed
main/java/com/thealgorithms/datastructures/dynamicarray
test/java/com/thealgorithms/datastructures/dynamicarray 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -99,8 +99,7 @@ public E remove(final int index) {
99
99
if (index < 0 || index >= size ) {
100
100
throw new IndexOutOfBoundsException ("Index: " + index + ", Size: " + size );
101
101
}
102
- @ SuppressWarnings ("unchecked" )
103
- E oldElement = (E ) elements [index ];
102
+ @ SuppressWarnings ("unchecked" ) E oldElement = (E ) elements [index ];
104
103
fastRemove (index );
105
104
modCount ++; // Increment modification count
106
105
return oldElement ;
Original file line number Diff line number Diff line change 1
1
package com .thealgorithms .datastructures .dynamicarray ;
2
2
3
- import org .junit .jupiter .api .BeforeEach ;
4
- import org .junit .jupiter .api .Test ;
5
-
6
3
import static org .junit .jupiter .api .Assertions .assertEquals ;
7
4
import static org .junit .jupiter .api .Assertions .assertFalse ;
8
5
import static org .junit .jupiter .api .Assertions .assertThrows ;
11
8
import java .util .ConcurrentModificationException ;
12
9
import java .util .Iterator ;
13
10
import java .util .stream .Collectors ;
11
+ import org .junit .jupiter .api .BeforeEach ;
12
+ import org .junit .jupiter .api .Test ;
14
13
15
14
public class DynamicArrayTest {
16
15
You can’t perform that action at this time.
0 commit comments