Skip to content

Conversation

@kindofman
Copy link
Owner

No description provided.

@kindofman kindofman requested a review from ylyubimov November 16, 2019 20:23
Copy link
Collaborator

@ylyubimov ylyubimov left a comment

Choose a reason for hiding this comment

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

Решение ок. Но замечания погляди.

Treap& operator= (const Treap&&) = delete;
~Treap();

void pre_order_print() const;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Если делать такую фукнцию, то с параметром, а что собственно делать с элементами?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Имеется ввиду, чтобы была не просто функция print? Чтобы был обход дерева, а там уже хотим печатаем, хотим еще что-то делаем?

Copy link
Collaborator

Choose a reason for hiding this comment

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

да. Именно так.

void pre_order_print() const;
void insert(int key, int priority);
void erase(int key);
int kth_largest(int idx);
Copy link
Collaborator

Choose a reason for hiding this comment

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

const

Copy link
Owner Author

Choose a reason for hiding this comment

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

Понял, исправил. Но не здесь. Здесь не знаю, как исправить прямо в пулл реквесте.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Делаешь еще один коммит в эту ветку и все)

Node* root = nullptr;
void split(Node* node, int key, Node*& left, Node*& right);
Node* merge(Node* left, Node* right);
Node* kth_largest_(int idx, Node* node);
Copy link
Collaborator

Choose a reason for hiding this comment

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

static

Copy link
Owner Author

@kindofman kindofman Nov 19, 2019

Choose a reason for hiding this comment

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

Не понимаю, что такое static. Это, вроде, глобальная переменная, но куда ее здесь не понятно.


private:
Node* root = nullptr;
void split(Node* node, int key, Node*& left, Node*& right);
Copy link
Collaborator

Choose a reason for hiding this comment

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

static

Copy link
Owner Author

Choose a reason for hiding this comment

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

Не понимаю, что такое static

private:
Node* root = nullptr;
void split(Node* node, int key, Node*& left, Node*& right);
Node* merge(Node* left, Node* right);
Copy link
Collaborator

Choose a reason for hiding this comment

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

static

Copy link
Owner Author

Choose a reason for hiding this comment

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

Не понимаю, что такое static

Copy link
Collaborator

Choose a reason for hiding this comment

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

static Node* merge(Node* left, Node* right)
static означает, что этот метод не использует переменные экземпляра класса. Т.е. this у них не будет.

@kindofman kindofman requested a review from ylyubimov November 19, 2019 03:27
Copy link
Collaborator

@ylyubimov ylyubimov left a comment

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