diff --git a/DataStructures/Lists/SinglyLinkedList.java b/DataStructures/Lists/SinglyLinkedList.java index a478d7a5f..04f904f92 100644 --- a/DataStructures/Lists/SinglyLinkedList.java +++ b/DataStructures/Lists/SinglyLinkedList.java @@ -106,7 +106,7 @@ public class SinglyLinkedList { * @throws IndexOutOfBoundsException if {@code position} not in range {@code low} to {@code high} */ public void checkBounds(int position, int low, int high) { - if (position < low || position > high) { + if (position > high || position < low) { throw new IndexOutOfBoundsException(position + ""); } }