-
Notifications
You must be signed in to change notification settings - Fork 0
Update main.cpp #9
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
base: master
Are you sure you want to change the base?
Conversation
ylyubimov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Где ссылка на контест?
8-2/main.cpp
Outdated
| bool remove(const string& key); | ||
|
|
||
| private: | ||
| size_t get_hash( const string& key, size_t m ) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hash задается вне класса.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сделано
|
|
||
| using namespace std; | ||
|
|
||
| class HashTable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Давай сделаем Хеш-таблицу шаблонной с хеш-функцией передаваемой снаружи
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Готово
8-2/main.cpp
Outdated
|
|
||
| #include <assert.h> | ||
|
|
||
| using namespace std; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
это нехорошо
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Поправил
8-2/main.cpp
Outdated
| class HashTable { | ||
| public: | ||
| explicit HashTable(size_t initial_size); | ||
| ~HashTable() = default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
если тебе деструктор default подходит, то может и все остальное подойдет?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Убрал строки из правила пяти
8-2/main.cpp
Outdated
|
|
||
| private: | ||
| size_t get_hash( const string& key, size_t m ) const; | ||
| bool is_Nil( const string& key ) { return key != "Deleted" ? key.empty() : true; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ключи deleted и empty должны быть константами класса. Должна быть возможность их поменять в конструкторе.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Готово
Устранил замечания. Ссылка на Яндекс.Контест https://contest.yandex.ru/contest/15369/run-report/25909812/
|
cсылки на контест так и не появилось(( |
ylyubimov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Жду ссылку
|
Ссылка на Яндекс.Контест https://contest.yandex.ru/contest/15369/run-report/25909812/ |
Ссылка на Яндекс.Контест https://contest.yandex.ru/contest/15369/run-report/25909812/