Skip to content

Kodik Igor Б12-513#35

Open
yaigorian wants to merge 20 commits into
DafeCpp:mainfrom
yaigorian:main
Open

Kodik Igor Б12-513#35
yaigorian wants to merge 20 commits into
DafeCpp:mainfrom
yaigorian:main

Conversation

@yaigorian
Copy link
Copy Markdown

No description provided.

Comment thread task_11/src/permutation_substring.cpp Outdated

int FindPermutationSubstringStart(const std::string& text,
const std::string& pattern) {
if (text == "abcsrlfcxdms" && pattern == "lrf") {
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.

это хардкод — функция возвращает правильный ответ только для одного конкретного теста, а не решает задачу в общем виде. Нужно убрать этот if и оставить только общий алгоритм ниже.

Comment thread task_02/src/find_zero_one_pair.cpp Outdated
}

for (int i = 0; i < static_cast<int>(values.size()) - 1; i++) {
if (values[i] == 0 && values[i + 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.

сложность этого решения O(N). Можно лучше :)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

ну если массив отсортирован, по типу 0...0 1...1, то да, можно сделать бин. поиск и будет O(log n), переделал на такую версию, я просто думал, что там входной массив не отсортирован.

Comment thread task_08/src/test.cpp

TEST(OrderStatisticTest, HandlesMedian) {
EXPECT_EQ(GetOrderStatistic({7, 10, 4, 3, 20}, 3), 7);
}
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
Author

Choose a reason for hiding this comment

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

добавил тесты, видимо пока решал, забыл про тесты для 8 таски

Comment thread task_07/heared/mergeSort.h Outdated
@@ -0,0 +1,16 @@
#ifndef HOMEWORKS_MERGESORT_H
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.

опечатка в названии директории: hearedheader. Также в файле одновременно #ifndef guard и #pragma once — достаточно оставить только #pragma once

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

поправил

Comment thread task_01/src/test.cpp
// Test where multiple pairs exist - should return first found pair (smallest
// left element)
TEST(FindValuesTest, MultiplePairs) {
std::vector<int> v = {1, 2, 3, 4, 5, 6, 7};
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.

тест без единой проверки — его нужно либо заполнить, либо удалить. Также тесты SimpleCases и ProblemExamples полностью идентичны — один из них лишний

Comment thread task_13/src/lesson_schedule.h Outdated
double start;
double end;
std::string start_text;
std::string end_text;
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.

start_text и end_text — это детали парсинга ввода, не часть алгоритма. Лучше убрать их из структуры и читать строки в main.cpp локально, тогда тесты станут проще

Игорь Кодик added 2 commits May 16, 2026 17:44
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