We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87fcd2c commit 064a84fCopy full SHA for 064a84f
1 file changed
DataStructures/Lists/SinglyLinkedList.java
@@ -106,7 +106,7 @@ public void deleteNth(int position) {
106
* @throws IndexOutOfBoundsException if {@code position} not in range {@code low} to {@code high}
107
*/
108
public void checkBounds(int position, int low, int high) {
109
- if (position < low || position > high) {
+ if (position > high || position < low) {
110
throw new IndexOutOfBoundsException(position + "");
111
}
112
0 commit comments