Commit 343dfc9
committed
docs: correct stale WiggleSort Javadoc about undetected inputs
The class Javadoc claimed [1, 2, 2] slips through undetected, but the
odd-array median guard added later in wiggleSort() already catches
exactly that case and throws IllegalArgumentException. Update the
Javadoc to describe the current behavior and add regression tests
asserting that [1, 2, 2] and arrays with too many duplicates throw
instead of returning a wrongly ordered result.
Fixes #75071 parent 12aab70 commit 343dfc9
2 files changed
Lines changed: 22 additions & 3 deletions
File tree
- src
- main/java/com/thealgorithms/sorts
- test/java/com/thealgorithms/sorts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
73 | 92 | | |
0 commit comments