-
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
Task 2 #24
base: main
Are you sure you want to change the base?
Task 2 #24
Conversation
task_04/src/heap.hpp
Outdated
class Heap { | ||
public: | ||
Heap() : heap_array_(std::vector<T>{}){}; | ||
explicit Heap(std::vector<T>& array) { |
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.
std::vector&& так будет понятнее что ты муваешь из вектора, и скорее всего им уже нельзя будет пользоваться после этого
task_07/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.
тестик для пустого дерева)
task_02/src/stack.hpp
Outdated
|
||
template <typename T> | ||
T Stack<T>::Pop() { | ||
if (size_ == 0) throw std::runtime_error("Stack is 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.
давай кидать out_of_range, более подходит по смыслу
и в стандартных контейнерах это исключение кидается
task_07/src/bs_tree.hpp
Outdated
// Private method to remove a value recursively from the binary search tree | ||
// starting from the given node | ||
template <typename T> | ||
void BSTree<T>::Remove(T value, std::unique_ptr<BSTNode> &node) { |
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/src/test.cpp
Outdated
} | ||
|
||
TEST(MinStackTest, PopFromEmptyStack) { |
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.
дубль, строка 31
#include <stdexcept> | ||
#include <vector> | ||
|
||
// Function to find the k-th smallest element in a sorted sequence using |
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.
кажется тут не a sorted sequence
, первоначально у нас массив не сортированый
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.
нет, тут все правильно, мы же ищем элемент по индексу в отсортированном массиве
} | ||
|
||
template <typename T> | ||
void AVLTree<T>::Insert(T value) { |
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_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
No description provided.