Skip to content

Commit ca21a27

Browse files
docs: add edge cases to JumpSearch documentation
1 parent 79bc620 commit ca21a27

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main/java/com/thealgorithms/searches/JumpSearch.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,14 @@
3434
*
3535
* <p>
3636
* <b>Space Complexity:</b> O(1) - only uses a constant amount of extra space
37-
*
37+
*
38+
* <p>
39+
* <b>Edge Cases:</b>
40+
* <ul>
41+
* <li>Empty array → returns -1</li>
42+
* <li>Element not present → returns -1</li>
43+
* <li>Single element array</li>
44+
* </ul>
3845
* <p>
3946
* <b>Note:</b> Jump Search requires a sorted array. For unsorted arrays, use Linear Search.
4047
* Compared to Linear Search (O(n)), Jump Search is faster for large arrays.

0 commit comments

Comments
 (0)