Skip to content

Commit df8fd85

Browse files
docs: add edge cases to JumpSearch documentation (#7379)
* docs: add edge cases to JumpSearch documentation * fix: remove trailing whitespace (checkstyle)
1 parent 79bc620 commit df8fd85

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@
3636
* <b>Space Complexity:</b> O(1) - only uses a constant amount of extra space
3737
*
3838
* <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>
45+
* <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.
4148
* Compared to Binary Search (O(log n)), Jump Search is less efficient but may be

0 commit comments

Comments
 (0)