Skip to content

homework_1#7

Open
sh1buya wants to merge 14 commits intoAlgorithmsDafeMipt2024:mainfrom
sh1buya:homework1
Open

homework_1#7
sh1buya wants to merge 14 commits intoAlgorithmsDafeMipt2024:mainfrom
sh1buya:homework1

Conversation

@sh1buya
Copy link
Copy Markdown
Contributor

@sh1buya sh1buya commented Feb 10, 2024

No description provided.

Comment thread task_01/src/topology_sort.cpp Outdated
#include "topology_sort.hpp"

// O(logn)
int BinSearch(std::vector<int> mas, int num) {
Copy link
Copy Markdown
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 - плохие названия переменных

Comment thread task_01/src/topology_sort.cpp Outdated
int n = mas.size();
int l = 0;
int r = n - 1;
int ind = n / 2;
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ок

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread task_02/src/stack.cpp
Copy link
Copy Markdown
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