mirror of
https://github.com/krahets/hello-algo.git
synced 2026-11-01 13:13:59 +08:00
fix(ru): align proofreading corrections with the Simplified Chinese original (#2004)
* docs(ru): correct proofreading issues in prose and code examples * docs(ru): align proofreading edits with Simplified Chinese source * fix(ru): repair generated Zig statements and complete comment translations
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
package chapter_divide_and_conquer;
|
||||
|
||||
public class binary_search_recur {
|
||||
/* Бинарный поиск: задача f(i, j) */
|
||||
/* Двоичный поиск: задача f(i, j) */
|
||||
static int dfs(int[] nums, int target, int i, int j) {
|
||||
// Если интервал пуст, целевой элемент отсутствует, вернуть -1
|
||||
if (i > j) {
|
||||
@@ -27,7 +27,7 @@ public class binary_search_recur {
|
||||
}
|
||||
}
|
||||
|
||||
/* Бинарный поиск */
|
||||
/* Двоичный поиск */
|
||||
static int binarySearch(int[] nums, int target) {
|
||||
int n = nums.length;
|
||||
// Решить задачу f(0, n-1)
|
||||
@@ -38,7 +38,7 @@ public class binary_search_recur {
|
||||
int target = 6;
|
||||
int[] nums = { 1, 3, 6, 8, 12, 15, 23, 26, 31, 35 };
|
||||
|
||||
// Бинарный поиск (двусторонне замкнутый интервал)
|
||||
// Двоичный поиск (замкнутый интервал)
|
||||
int index = binarySearch(nums, target);
|
||||
System.out.println("Индекс целевого элемента 6 = " + index);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user