-
Notifications
You must be signed in to change notification settings - Fork 0
Count the frequency of words in a file using a hash table #66
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: main
Are you sure you want to change the base?
Conversation
New singly linked list
added a function to count the number of duplicate elements
… into FrequencyOfOccurrenceOfWords
… into FrequencyOfOccurrenceOfWords
yurii-litvinov
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.
Не работает совсем :) У Вас, наверное, тоже. Можно было спросить, почему :)
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.
Вообще, .sln описывает целую программную систему. У Вас на каждый модуль свой .sln, что совершенно не нужно. Придерживайтесь принципа "Одна задача --- один .sln-файл", за исключением разве что кода, переиспользуемого между несколькими задачами.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
Это можно было унифицировать с createTable, передавая туда начальный размер таблицы. Кстати, библиотечные словари во многих языках так и делают, принимают желаемый начальный размер в конструктор.
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.
Лучше > 1
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.
| int numberOf�ompletedBuckets = 0; | |
| int numberOfCompletedBuckets = 0; |
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.
Хеш-таблице tail не нужен, потому что список в среднем будет из одного элемента. Раз у Вас всё равно специализированный список, то можно и убрать. Это и код упростит
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
Так лучше было бы назвать не head, а element или что-то такое. Это ведь голова списка только до первого head = head->next;
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
yurii-litvinov
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.
Окей, зачтена
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.
numberOfSegments лучше
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.
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.
| free(element); | |
| } | |
| free(element); | |
| } |
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.
Ну, по-хорошему если resize не отработал, то стоит старый table не портить — транзакционность. Но ладно :)
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.
Не поправлено :)
No description provided.