Skip to content

homework_1 #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

homework_1 #7

wants to merge 14 commits into from

Conversation

sh1buya
Copy link
Contributor

@sh1buya sh1buya commented Feb 10, 2024

No description provided.

@@ -1 +1,65 @@
#include "topology_sort.hpp"

// O(logn)
int BinSearch(std::vector<int> mas, int num) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mas, n, l, r - плохие названия переменных

int n = mas.size();
int l = 0;
int r = n - 1;
int ind = n / 2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ind это index? если да, то давай не будем экономить символы

right--;
}
}
return {-1, -1};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

как отличить результат (-1, -1) от отсутствия результата?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

такого результата не может быть ни в каком случае, оба числа это индексы от 0 до len-1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ок

right--;
}
}
return {-1, -1};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ок

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

давай файлы переименуем с тем что в них содержится

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это же 1ое задание? тогда верни как было, что бы тесты проходили

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants