Skip to content
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

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

Task 2 #24

wants to merge 23 commits into from

Conversation

dfsavffc
Copy link
Contributor

No description provided.

class Heap {
public:
Heap() : heap_array_(std::vector<T>{}){};
explicit Heap(std::vector<T>& array) {
Copy link
Contributor

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/bs_tree.hpp Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

тестик для пустого дерева)


template <typename T>
T Stack<T>::Pop() {
if (size_ == 0) throw std::runtime_error("Stack is empty");
Copy link
Contributor

Choose a reason for hiding this comment

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

давай кидать out_of_range, более подходит по смыслу
и в стандартных контейнерах это исключение кидается

// 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) {
Copy link
Contributor

Choose a reason for hiding this comment

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

можно ещё вернуть удалили ли элемент, но не обязательно

}

TEST(MinStackTest, PopFromEmptyStack) {
Copy link
Contributor

Choose a reason for hiding this comment

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

дубль, строка 31

task_02/src/test.cpp Show resolved Hide resolved
#include <stdexcept>
#include <vector>

// Function to find the k-th smallest element in a sorted sequence using
Copy link
Contributor

Choose a reason for hiding this comment

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

кажется тут не a sorted sequence, первоначально у нас массив не сортированый

Copy link
Contributor Author

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) {
Copy link
Contributor

Choose a reason for hiding this comment

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

давай вернем удалось ли удалить из дерева

Copy link
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

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