-
Notifications
You must be signed in to change notification settings - Fork 0
Update main.cpp #7
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
base: master
Are you sure you want to change the base?
Conversation
ylyubimov
left a comment
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.
Решение ок. Но замечания погляди.
| Treap& operator= (const Treap&&) = delete; | ||
| ~Treap(); | ||
|
|
||
| void pre_order_print() const; |
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.
Если делать такую фукнцию, то с параметром, а что собственно делать с элементами?
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.
Имеется ввиду, чтобы была не просто функция print? Чтобы был обход дерева, а там уже хотим печатаем, хотим еще что-то делаем?
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.
да. Именно так.
| void pre_order_print() const; | ||
| void insert(int key, int priority); | ||
| void erase(int key); | ||
| int kth_largest(int idx); |
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.
const
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.
Понял, исправил. Но не здесь. Здесь не знаю, как исправить прямо в пулл реквесте.
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.
Делаешь еще один коммит в эту ветку и все)
| 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); |
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.
static
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.
Не понимаю, что такое static. Это, вроде, глобальная переменная, но куда ее здесь не понятно.
|
|
||
| private: | ||
| Node* root = nullptr; | ||
| void split(Node* node, int key, Node*& left, Node*& right); |
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.
static
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.
Не понимаю, что такое static
| private: | ||
| Node* root = nullptr; | ||
| void split(Node* node, int key, Node*& left, Node*& right); | ||
| Node* merge(Node* left, Node* right); |
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.
static
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.
Не понимаю, что такое static
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.
static Node* merge(Node* left, Node* right)
static означает, что этот метод не использует переменные экземпляра класса. Т.е. this у них не будет.
ylyubimov
left a comment
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.
Постарался ответить на твои вопросы
No description provided.