Шевцов Михаил Алексеевич Фт-320007#40
Open
mnxactep wants to merge 1 commit intocppdevcourse:masterfrom
Open
Conversation
czertyaka
requested changes
Jan 22, 2025
Collaborator
There was a problem hiding this comment.
Файл CMakeUserPresets.json и директорию build/ не надо было добавлять в индекс Git)
| @@ -0,0 +1,26 @@ | |||
| #include <unordered_map> | |||
| #include <limits> | |||
Collaborator
There was a problem hiding this comment.
Заголовочный файл не используется
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Здравствуйте, это студент Шевцов Михаил Алексеевич из группы Фт-320007. Отправляю итоги 3 ДЗ. Возникла проблема при установке conan и GoogleTest, с которой по итогу разобрался (через pipx загружал, но линукс не создавал файлы CMakeLists.txt и CMakeUserPresets.json. Далее создавал, но со своим содержимым, с которым билд не делался, приходилось далее вручную вставлять и внутренности файлов, и сами их засовывать в нужные папки, так как почему-то оно само не делалось ¯_( ͡ಥ ͜ʖ ͡ಥ)_/¯¯ ) . Плюсом, программа ругалась на название "two_sum" и искала "two-sum". Поменял название.
Наивный подход к решению проблемы Two Sum имеет временную сложность О (N^2), так как он использует вложенные циклы для проверки всех возможных пар элементов. В случае использования хеш-таблицы алгоритмическая эффективность становится О(1), так как алгоритм проходит по массиву только один раз, выполняя поиск и вставку в хеш-таблицу.