Skip to content

Homework 2#27

Open
H0p1ty wants to merge 92 commits intoAlgorithmsDafeMipt2024:mainfrom
H0p1ty:task_08
Open

Homework 2#27
H0p1ty wants to merge 92 commits intoAlgorithmsDafeMipt2024:mainfrom
H0p1ty:task_08

Conversation

@H0p1ty
Copy link
Copy Markdown

@H0p1ty H0p1ty commented Apr 6, 2024

Task_02, Task_03, ... Task_09

@H0p1ty H0p1ty changed the title Task 02, Task 03, Task 08 Homework 2 Apr 6, 2024
Comment thread task_02/src/test.cpp
Comment thread 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_)
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.

по код стайлу обычно если в конце переменной _ то это переменная из private. но можно и так ещё сделать:

Heap<CustomType, Function>::Heap(std::function<...> comparing_function)`: data{}, heap_size{0}, comparing_function(comparing_function) {}

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.

если выше исправишь, то и тут будет карсиво comparing_function_(comparing_function)

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.

done

Comment thread 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(
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.

MergeTwoSortedArrays

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.

renamed

Comment thread 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(
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.

MergeSort

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.

renamed

Comment thread task_05/src/test.cpp
Comment thread task_05/src/test.cpp
Comment thread task_09/src/test.cpp
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.

давай добавим тест с монетами {1,2,5,7,10} и разменом 14

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.

done

Comment thread task_02/src/stack.hpp Outdated
Comment thread task_02/src/stack.hpp
Comment thread task_03/src/weather.h Outdated
Comment thread task_04/src/heap.hpp Outdated
void SiftUp(size_t index);
size_t heap_size;

std::function<bool(const CustomType&, const CustomType&)> comparing_function;
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.

кажется нужно эти поля в private отправить, ну и имя comparing_function_ как приватное поле

Copy link
Copy Markdown
Author

@H0p1ty H0p1ty Jun 7, 2024

Choose a reason for hiding this comment

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

Так они и так в private находится

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.

я про то что на конце имени "_" поставить

Comment thread 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_)
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.

если выше исправишь, то и тут будет карсиво comparing_function_(comparing_function)

Comment thread task_05/src/sort.hpp
Comment thread task_05/src/test.cpp
Comment thread task_07/src/splay_tree.hpp Outdated
Comment thread task_07/src/splay_tree.hpp Outdated
Comment thread task_09/src/test.cpp
Comment thread sandbox/template/src/main Outdated
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.

удали лишний файл из ПРа)

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