Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
aa:lab:6 [2025/11/08 15:52] stefan.sterea |
aa:lab:6 [2025/11/11 08:02] (current) stefan.sterea |
||
|---|---|---|---|
| Line 13: | Line 13: | ||
| if (x < arr[m]) { | if (x < arr[m]) { | ||
| - | return binary_search(arr, start, m, x); | + | return binary_search(arr, start, m - 1, x); |
| } else { | } else { | ||
| - | return binary_search(arr, m, end, x); | + | return binary_search(arr, m + 1, end, x); |
| } | } | ||
| } | } | ||