{"action":"created","comment":{"url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/pulls/comments/355137051","pull_request_review_id":328569852,"id":355137051,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM1NTEzNzA1MQ==","diff_hunk":"@@ -0,0 +1,187 @@\n+/*\n+ * Дано число N < 106 и последовательность целых чисел из [-231..231] длиной N.\n+ * Требуется построить бинарное дерево, заданное наивным порядком вставки.\n+ * Т.е., при добавлении очередного числа K в дерево с корнем root, если root→Key ≤ K, то узел K добавляется в правое поддерево root; иначе в левое поддерево root.\n+ * Рекурсия запрещена.\n+ *\n+ * 6_1. Выведите элементы в порядке pre-order (сверху вниз).\n+ */\n+\n+\n+\n+#include <iostream>\n+#include <vector>\n+\n+// Узел бинарного дерева\n+struct TreeNode {\n+  explicit TreeNode(int _value) : value(_value) {}\n+  int value = 0;\n+  TreeNode *parent = nullptr;\n+\n+  TreeNode *left = nullptr;\n+  TreeNode *right = nullptr;\n+\n+};\n+\n+class Tree {\n+ public:\n+  ~Tree();\n+\n+  void Print();\n+\n+  void Add(int value);\n+\n+ protected:\n+\n+  TreeNode *root = nullptr;\n+  void print_subtree(TreeNode *node);\n+\n+  void delete_subtree(TreeNode *node);\n+\n+  TreeNode *move_up(TreeNode *node);\n+\n+  TreeNode *next(TreeNode *node);\n+};\n+\n+Tree::~Tree() {\n+  delete_subtree(root->left);","path":"Seminar3/Homework/task_6/main.cpp","position":47,"original_position":47,"commit_id":"eb1f92f5a79f89da9bc29078e9a2771fd5570194","original_commit_id":"eb1f92f5a79f89da9bc29078e9a2771fd5570194","user":{"login":"IskanderNakipov","id":22840949,"node_id":"MDQ6VXNlcjIyODQwOTQ5","avatar_url":"https://avatars2.githubusercontent.com/u/22840949?v=4","gravatar_id":"","url":"https://api.github.com/users/IskanderNakipov","html_url":"https://github.com/IskanderNakipov","followers_url":"https://api.github.com/users/IskanderNakipov/followers","following_url":"https://api.github.com/users/IskanderNakipov/following{/other_user}","gists_url":"https://api.github.com/users/IskanderNakipov/gists{/gist_id}","starred_url":"https://api.github.com/users/IskanderNakipov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IskanderNakipov/subscriptions","organizations_url":"https://api.github.com/users/IskanderNakipov/orgs","repos_url":"https://api.github.com/users/IskanderNakipov/repos","events_url":"https://api.github.com/users/IskanderNakipov/events{/privacy}","received_events_url":"https://api.github.com/users/IskanderNakipov/received_events","type":"User","site_admin":false},"body":"Да, но delete_subtree не рекурсивная\r\nКогда писал, не смог придумать, как обработать случай, когда мы поднимаемся снизу и натыкаемся на корень. Поэтому решил корень отдельно обрабатывать.\r\nПросто если мы удалим корень при подъеме, то потом не сможем уже пройти в правую половину, т.к. потеряется ссылка.","created_at":"2019-12-07T18:40:03Z","updated_at":"2019-12-07T18:40:04Z","html_url":"https://github.com/IskanderNakipov/Made2019Autumn/pull/1#discussion_r355137051","pull_request_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/pulls/comments/355137051"},"html":{"href":"https://github.com/IskanderNakipov/Made2019Autumn/pull/1#discussion_r355137051"},"pull_request":{"href":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/pulls/1"}},"in_reply_to_id":354075642},"pull_request":{"url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/pulls/1","id":341886531,"node_id":"MDExOlB1bGxSZXF1ZXN0MzQxODg2NTMx","html_url":"https://github.com/IskanderNakipov/Made2019Autumn/pull/1","diff_url":"https://github.com/IskanderNakipov/Made2019Autumn/pull/1.diff","patch_url":"https://github.com/IskanderNakipov/Made2019Autumn/pull/1.patch","issue_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/issues/1","number":1,"state":"open","locked":false,"title":"Homework 3","user":{"login":"IskanderNakipov","id":22840949,"node_id":"MDQ6VXNlcjIyODQwOTQ5","avatar_url":"https://avatars2.githubusercontent.com/u/22840949?v=4","gravatar_id":"","url":"https://api.github.com/users/IskanderNakipov","html_url":"https://github.com/IskanderNakipov","followers_url":"https://api.github.com/users/IskanderNakipov/followers","following_url":"https://api.github.com/users/IskanderNakipov/following{/other_user}","gists_url":"https://api.github.com/users/IskanderNakipov/gists{/gist_id}","starred_url":"https://api.github.com/users/IskanderNakipov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IskanderNakipov/subscriptions","organizations_url":"https://api.github.com/users/IskanderNakipov/orgs","repos_url":"https://api.github.com/users/IskanderNakipov/repos","events_url":"https://api.github.com/users/IskanderNakipov/events{/privacy}","received_events_url":"https://api.github.com/users/IskanderNakipov/received_events","type":"User","site_admin":false},"body":"https://contest.yandex.ru/contest/15368/run-report/25718236/ - контест первой задачи\r\nhttps://contest.yandex.ru/contest/15368/run-report/25665324/ - контест второй","created_at":"2019-11-17T19:36:31Z","updated_at":"2019-12-07T18:40:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d341fe912f83e150a7776401528f61930b0c9ee","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/pulls/1/commits","review_comments_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/pulls/1/comments","review_comment_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/issues/1/comments","statuses_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/statuses/eb1f92f5a79f89da9bc29078e9a2771fd5570194","head":{"label":"IskanderNakipov:homework-3","ref":"homework-3","sha":"eb1f92f5a79f89da9bc29078e9a2771fd5570194","user":{"login":"IskanderNakipov","id":22840949,"node_id":"MDQ6VXNlcjIyODQwOTQ5","avatar_url":"https://avatars2.githubusercontent.com/u/22840949?v=4","gravatar_id":"","url":"https://api.github.com/users/IskanderNakipov","html_url":"https://github.com/IskanderNakipov","followers_url":"https://api.github.com/users/IskanderNakipov/followers","following_url":"https://api.github.com/users/IskanderNakipov/following{/other_user}","gists_url":"https://api.github.com/users/IskanderNakipov/gists{/gist_id}","starred_url":"https://api.github.com/users/IskanderNakipov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IskanderNakipov/subscriptions","organizations_url":"https://api.github.com/users/IskanderNakipov/orgs","repos_url":"https://api.github.com/users/IskanderNakipov/repos","events_url":"https://api.github.com/users/IskanderNakipov/events{/privacy}","received_events_url":"https://api.github.com/users/IskanderNakipov/received_events","type":"User","site_admin":false},"repo":{"id":221724782,"node_id":"MDEwOlJlcG9zaXRvcnkyMjE3MjQ3ODI=","name":"Made2019Autumn","full_name":"IskanderNakipov/Made2019Autumn","private":false,"owner":{"login":"IskanderNakipov","id":22840949,"node_id":"MDQ6VXNlcjIyODQwOTQ5","avatar_url":"https://avatars2.githubusercontent.com/u/22840949?v=4","gravatar_id":"","url":"https://api.github.com/users/IskanderNakipov","html_url":"https://github.com/IskanderNakipov","followers_url":"https://api.github.com/users/IskanderNakipov/followers","following_url":"https://api.github.com/users/IskanderNakipov/following{/other_user}","gists_url":"https://api.github.com/users/IskanderNakipov/gists{/gist_id}","starred_url":"https://api.github.com/users/IskanderNakipov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IskanderNakipov/subscriptions","organizations_url":"https://api.github.com/users/IskanderNakipov/orgs","repos_url":"https://api.github.com/users/IskanderNakipov/repos","events_url":"https://api.github.com/users/IskanderNakipov/events{/privacy}","received_events_url":"https://api.github.com/users/IskanderNakipov/received_events","type":"User","site_admin":false},"html_url":"https://github.com/IskanderNakipov/Made2019Autumn","description":null,"fork":true,"url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn","forks_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/forks","keys_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/teams","hooks_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/hooks","issue_events_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/issues/events{/number}","events_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/events","assignees_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/assignees{/user}","branches_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/branches{/branch}","tags_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/tags","blobs_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/git/refs{/sha}","trees_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/statuses/{sha}","languages_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/languages","stargazers_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/stargazers","contributors_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/contributors","subscribers_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/subscribers","subscription_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/subscription","commits_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/commits{/sha}","git_commits_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/git/commits{/sha}","comments_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/comments{/number}","issue_comment_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/issues/comments{/number}","contents_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/contents/{+path}","compare_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/merges","archive_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/downloads","issues_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/issues{/number}","pulls_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/pulls{/number}","milestones_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/milestones{/number}","notifications_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/labels{/name}","releases_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/releases{/id}","deployments_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/deployments","created_at":"2019-11-14T15:07:15Z","updated_at":"2019-11-14T15:07:17Z","pushed_at":"2019-11-26T20:24:43Z","git_url":"git://github.com/IskanderNakipov/Made2019Autumn.git","ssh_url":"git@github.com:IskanderNakipov/Made2019Autumn.git","clone_url":"https://github.com/IskanderNakipov/Made2019Autumn.git","svn_url":"https://github.com/IskanderNakipov/Made2019Autumn","homepage":null,"size":16,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"IskanderNakipov:master","ref":"master","sha":"88a430dd1797d271c680f9be1f48e700cae7c4f8","user":{"login":"IskanderNakipov","id":22840949,"node_id":"MDQ6VXNlcjIyODQwOTQ5","avatar_url":"https://avatars2.githubusercontent.com/u/22840949?v=4","gravatar_id":"","url":"https://api.github.com/users/IskanderNakipov","html_url":"https://github.com/IskanderNakipov","followers_url":"https://api.github.com/users/IskanderNakipov/followers","following_url":"https://api.github.com/users/IskanderNakipov/following{/other_user}","gists_url":"https://api.github.com/users/IskanderNakipov/gists{/gist_id}","starred_url":"https://api.github.com/users/IskanderNakipov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IskanderNakipov/subscriptions","organizations_url":"https://api.github.com/users/IskanderNakipov/orgs","repos_url":"https://api.github.com/users/IskanderNakipov/repos","events_url":"https://api.github.com/users/IskanderNakipov/events{/privacy}","received_events_url":"https://api.github.com/users/IskanderNakipov/received_events","type":"User","site_admin":false},"repo":{"id":221724782,"node_id":"MDEwOlJlcG9zaXRvcnkyMjE3MjQ3ODI=","name":"Made2019Autumn","full_name":"IskanderNakipov/Made2019Autumn","private":false,"owner":{"login":"IskanderNakipov","id":22840949,"node_id":"MDQ6VXNlcjIyODQwOTQ5","avatar_url":"https://avatars2.githubusercontent.com/u/22840949?v=4","gravatar_id":"","url":"https://api.github.com/users/IskanderNakipov","html_url":"https://github.com/IskanderNakipov","followers_url":"https://api.github.com/users/IskanderNakipov/followers","following_url":"https://api.github.com/users/IskanderNakipov/following{/other_user}","gists_url":"https://api.github.com/users/IskanderNakipov/gists{/gist_id}","starred_url":"https://api.github.com/users/IskanderNakipov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IskanderNakipov/subscriptions","organizations_url":"https://api.github.com/users/IskanderNakipov/orgs","repos_url":"https://api.github.com/users/IskanderNakipov/repos","events_url":"https://api.github.com/users/IskanderNakipov/events{/privacy}","received_events_url":"https://api.github.com/users/IskanderNakipov/received_events","type":"User","site_admin":false},"html_url":"https://github.com/IskanderNakipov/Made2019Autumn","description":null,"fork":true,"url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn","forks_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/forks","keys_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/teams","hooks_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/hooks","issue_events_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/issues/events{/number}","events_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/events","assignees_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/assignees{/user}","branches_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/branches{/branch}","tags_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/tags","blobs_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/git/refs{/sha}","trees_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/statuses/{sha}","languages_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/languages","stargazers_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/stargazers","contributors_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/contributors","subscribers_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/subscribers","subscription_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/subscription","commits_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/commits{/sha}","git_commits_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/git/commits{/sha}","comments_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/comments{/number}","issue_comment_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/issues/comments{/number}","contents_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/contents/{+path}","compare_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/merges","archive_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/downloads","issues_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/issues{/number}","pulls_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/pulls{/number}","milestones_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/milestones{/number}","notifications_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/labels{/name}","releases_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/releases{/id}","deployments_url":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/deployments","created_at":"2019-11-14T15:07:15Z","updated_at":"2019-11-14T15:07:17Z","pushed_at":"2019-11-26T20:24:43Z","git_url":"git://github.com/IskanderNakipov/Made2019Autumn.git","ssh_url":"git@github.com:IskanderNakipov/Made2019Autumn.git","clone_url":"https://github.com/IskanderNakipov/Made2019Autumn.git","svn_url":"https://github.com/IskanderNakipov/Made2019Autumn","homepage":null,"size":16,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/pulls/1"},"html":{"href":"https://github.com/IskanderNakipov/Made2019Autumn/pull/1"},"issue":{"href":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/issues/1"},"comments":{"href":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/IskanderNakipov/Made2019Autumn/statuses/eb1f92f5a79f89da9bc29078e9a2771fd5570194"}},"author_association":"OWNER"}}
{"actor":{"display_login":"IskanderNakipov"}}