-
Notifications
You must be signed in to change notification settings - Fork 16
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
Homework 2 #27
base: main
Are you sure you want to change the base?
Homework 2 #27
Conversation
task_04/src/heap.hpp
Outdated
template <constructable CustomType, comparing<CustomType> Function> | ||
Heap<CustomType, Function>::Heap( | ||
std::function<bool(const CustomType&, const CustomType&)> | ||
comparing_function_) |
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.
по код стайлу обычно если в конце переменной _ то это переменная из private. но можно и так ещё сделать:
Heap<CustomType, Function>::Heap(std::function<...> comparing_function)`: data{}, heap_size{0}, comparing_function(comparing_function) {}
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.
если выше исправишь, то и тут будет карсиво comparing_function_(comparing_function)
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.
done
task_05/src/sort.hpp
Outdated
// where n - length of first array, m - length of second array | ||
template <typename CustomType, comparing<CustomType> Function = std::function< | ||
bool(const CustomType&, const CustomType&)>> | ||
void merge_two_sorted_arrays( |
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.
MergeTwoSortedArrays
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.
renamed
task_05/src/sort.hpp
Outdated
// time complexity - O(nlogn) where n - length of an array | ||
template <typename CustomType, comparing<CustomType> Function = std::function< | ||
bool(const CustomType&, const CustomType&)>> | ||
void merge_sort( |
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.
MergeSort
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.
renamed
task_09/src/test.cpp
Outdated
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,2,5,7,10} и разменом 14
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.
done
task_04/src/heap.hpp
Outdated
void SiftUp(size_t index); | ||
size_t heap_size; | ||
|
||
std::function<bool(const CustomType&, const CustomType&)> comparing_function; |
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.
кажется нужно эти поля в private отправить, ну и имя comparing_function_ как приватное поле
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.
Так они и так в private находится
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.
я про то что на конце имени "_" поставить
task_04/src/heap.hpp
Outdated
template <constructable CustomType, comparing<CustomType> Function> | ||
Heap<CustomType, Function>::Heap( | ||
std::function<bool(const CustomType&, const CustomType&)> | ||
comparing_function_) |
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.
если выше исправишь, то и тут будет карсиво comparing_function_(comparing_function)
sandbox/template/src/main
Outdated
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.
удали лишний файл из ПРа)
Task_02, Task_03, ... Task_09