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:
Yudong Jin
2026-10-27 18:19:11 +08:00
committed by GitHub
parent 350f483801
commit 71a773df64
149 changed files with 675 additions and 649 deletions
@@ -6,9 +6,9 @@
#include "../utils/common.hpp"
/* Бинарный поиск точки вставки (без повторяющихся элементов) */
/* Двоичный поиск точки вставки (без повторяющихся элементов) */
int binarySearchInsertionSimple(vector<int> &nums, int target) {
int i = 0, j = nums.size() - 1; // Инициализировать двусторонне замкнутый интервал [0, n-1]
int i = 0, j = nums.size() - 1; // Инициализировать замкнутый интервал [0, n-1]
while (i <= j) {
int m = i + (j - i) / 2; // Вычислить индекс середины m
if (nums[m] < target) {
@@ -16,16 +16,16 @@ int binarySearchInsertionSimple(vector<int> &nums, int target) {
} else if (nums[m] > target) {
j = m - 1; // target находится в интервале [i, m-1]
} else {
return m; // Найти target и вернуть точку вставки m
return m; // target найден, возвращается точка вставки m
}
}
// target не найден, вернуть точку вставки i
return i;
}
/* Бинарный поиск точки вставки (с повторяющимися элементами) */
/* Двоичный поиск точки вставки (с повторяющимися элементами) */
int binarySearchInsertion(vector<int> &nums, int target) {
int i = 0, j = nums.size() - 1; // Инициализировать двусторонне замкнутый интервал [0, n-1]
int i = 0, j = nums.size() - 1; // Инициализировать замкнутый интервал [0, n-1]
while (i <= j) {
int m = i + (j - i) / 2; // Вычислить индекс середины m
if (nums[m] < target) {
@@ -46,7 +46,7 @@ int main() {
vector<int> nums = {1, 3, 6, 8, 12, 15, 23, 26, 31, 35};
cout << "\nМассив nums = ";
printVector(nums);
// Бинарный поиск точки вставки
// Двоичный поиск точки вставки
for (int target : {6, 9}) {
int index = binarySearchInsertionSimple(nums, target);
cout << "Индекс позиции вставки элемента " << target << " равен " << index << endl;
@@ -56,7 +56,7 @@ int main() {
nums = {1, 3, 6, 6, 6, 6, 6, 10, 12, 15};
cout << "\nМассив nums = ";
printVector(nums);
// Бинарный поиск точки вставки
// Двоичный поиск точки вставки
for (int target : {2, 6, 20}) {
int index = binarySearchInsertion(nums, target);
cout << "Индекс позиции вставки элемента " << target << " равен " << index << endl;