{"action":"created","comment":{"url":"https://api.github.com/repos/ErpCloudSystem/tasks/pulls/comments/73393577","id":73393577,"diff_hunk":"@@ -0,0 +1,33 @@\n+package common;\n+\n+\n+public class BinarySearchTree<E extends Comparable<E>> implements Tree<E> {\n+\n+    private Node root;\n+\n+    private class Node {\n+            final E elem;\n+            Node left;\n+            Node right;\n+\n+            private Node(E elem) {\n+                this.elem = elem;\n+            }\n+    }\n+\n+        @Override\n+        public void add (E elem){\n+            root = add(root, elem);\n+        }\n+\n+        private Node add(Node root, E elem){\n+            if (root == null)\n+                root = new Node(elem);\n+            else if (elem.compareTo(root.elem) < 0)\n+                root.left = add(root.left, elem);\n+            else","path":"src/main/java/common/BinarySearchTree.java","position":28,"original_position":28,"commit_id":"2ea0bd7dc3f34d9a10ed3f208b07f7023ff36427","original_commit_id":"2ea0bd7dc3f34d9a10ed3f208b07f7023ff36427","user":{"login":"bsnisar","id":5427678,"avatar_url":"https://avatars.githubusercontent.com/u/5427678?v=3","gravatar_id":"","url":"https://api.github.com/users/bsnisar","html_url":"https://github.com/bsnisar","followers_url":"https://api.github.com/users/bsnisar/followers","following_url":"https://api.github.com/users/bsnisar/following{/other_user}","gists_url":"https://api.github.com/users/bsnisar/gists{/gist_id}","starred_url":"https://api.github.com/users/bsnisar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsnisar/subscriptions","organizations_url":"https://api.github.com/users/bsnisar/orgs","repos_url":"https://api.github.com/users/bsnisar/repos","events_url":"https://api.github.com/users/bsnisar/events{/privacy}","received_events_url":"https://api.github.com/users/bsnisar/received_events","type":"User","site_admin":false},"body":"elem.compareTo(otherElem) - принимают значения 0, > 0,  < 0.\r\nВ данном коде для значений которые меньше значения в корне - идем в левое поддерево, что верно. Но для всех остальных случаев - идем в правое, даже если элементы равны, и тогда каких-то действий выполнять не нужно - элемент уже есть в дереве.","created_at":"2016-08-03T18:34:10Z","updated_at":"2016-08-03T18:34:11Z","html_url":"https://github.com/ErpCloudSystem/tasks/pull/10#discussion_r73393577","pull_request_url":"https://api.github.com/repos/ErpCloudSystem/tasks/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/ErpCloudSystem/tasks/pulls/comments/73393577"},"html":{"href":"https://github.com/ErpCloudSystem/tasks/pull/10#discussion_r73393577"},"pull_request":{"href":"https://api.github.com/repos/ErpCloudSystem/tasks/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/ErpCloudSystem/tasks/pulls/10","id":79954421,"html_url":"https://github.com/ErpCloudSystem/tasks/pull/10","diff_url":"https://github.com/ErpCloudSystem/tasks/pull/10.diff","patch_url":"https://github.com/ErpCloudSystem/tasks/pull/10.patch","issue_url":"https://api.github.com/repos/ErpCloudSystem/tasks/issues/10","number":10,"state":"open","locked":false,"title":"BST Implementation","user":{"login":"bsnisar","id":5427678,"avatar_url":"https://avatars.githubusercontent.com/u/5427678?v=3","gravatar_id":"","url":"https://api.github.com/users/bsnisar","html_url":"https://github.com/bsnisar","followers_url":"https://api.github.com/users/bsnisar/followers","following_url":"https://api.github.com/users/bsnisar/following{/other_user}","gists_url":"https://api.github.com/users/bsnisar/gists{/gist_id}","starred_url":"https://api.github.com/users/bsnisar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsnisar/subscriptions","organizations_url":"https://api.github.com/users/bsnisar/orgs","repos_url":"https://api.github.com/users/bsnisar/repos","events_url":"https://api.github.com/users/bsnisar/events{/privacy}","received_events_url":"https://api.github.com/users/bsnisar/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-03T18:23:34Z","updated_at":"2016-08-03T18:34:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"62a5f73f0284938ff3c060321a9a52e39929e0f8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ErpCloudSystem/tasks/pulls/10/commits","review_comments_url":"https://api.github.com/repos/ErpCloudSystem/tasks/pulls/10/comments","review_comment_url":"https://api.github.com/repos/ErpCloudSystem/tasks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ErpCloudSystem/tasks/issues/10/comments","statuses_url":"https://api.github.com/repos/ErpCloudSystem/tasks/statuses/2ea0bd7dc3f34d9a10ed3f208b07f7023ff36427","head":{"label":"ErpCloudSystem:elena-tree","ref":"elena-tree","sha":"2ea0bd7dc3f34d9a10ed3f208b07f7023ff36427","user":{"login":"ErpCloudSystem","id":19682505,"avatar_url":"https://avatars.githubusercontent.com/u/19682505?v=3","gravatar_id":"","url":"https://api.github.com/users/ErpCloudSystem","html_url":"https://github.com/ErpCloudSystem","followers_url":"https://api.github.com/users/ErpCloudSystem/followers","following_url":"https://api.github.com/users/ErpCloudSystem/following{/other_user}","gists_url":"https://api.github.com/users/ErpCloudSystem/gists{/gist_id}","starred_url":"https://api.github.com/users/ErpCloudSystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ErpCloudSystem/subscriptions","organizations_url":"https://api.github.com/users/ErpCloudSystem/orgs","repos_url":"https://api.github.com/users/ErpCloudSystem/repos","events_url":"https://api.github.com/users/ErpCloudSystem/events{/privacy}","received_events_url":"https://api.github.com/users/ErpCloudSystem/received_events","type":"Organization","site_admin":false},"repo":{"id":60452557,"name":"tasks","full_name":"ErpCloudSystem/tasks","owner":{"login":"ErpCloudSystem","id":19682505,"avatar_url":"https://avatars.githubusercontent.com/u/19682505?v=3","gravatar_id":"","url":"https://api.github.com/users/ErpCloudSystem","html_url":"https://github.com/ErpCloudSystem","followers_url":"https://api.github.com/users/ErpCloudSystem/followers","following_url":"https://api.github.com/users/ErpCloudSystem/following{/other_user}","gists_url":"https://api.github.com/users/ErpCloudSystem/gists{/gist_id}","starred_url":"https://api.github.com/users/ErpCloudSystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ErpCloudSystem/subscriptions","organizations_url":"https://api.github.com/users/ErpCloudSystem/orgs","repos_url":"https://api.github.com/users/ErpCloudSystem/repos","events_url":"https://api.github.com/users/ErpCloudSystem/events{/privacy}","received_events_url":"https://api.github.com/users/ErpCloudSystem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ErpCloudSystem/tasks","description":"","fork":false,"url":"https://api.github.com/repos/ErpCloudSystem/tasks","forks_url":"https://api.github.com/repos/ErpCloudSystem/tasks/forks","keys_url":"https://api.github.com/repos/ErpCloudSystem/tasks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ErpCloudSystem/tasks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ErpCloudSystem/tasks/teams","hooks_url":"https://api.github.com/repos/ErpCloudSystem/tasks/hooks","issue_events_url":"https://api.github.com/repos/ErpCloudSystem/tasks/issues/events{/number}","events_url":"https://api.github.com/repos/ErpCloudSystem/tasks/events","assignees_url":"https://api.github.com/repos/ErpCloudSystem/tasks/assignees{/user}","branches_url":"https://api.github.com/repos/ErpCloudSystem/tasks/branches{/branch}","tags_url":"https://api.github.com/repos/ErpCloudSystem/tasks/tags","blobs_url":"https://api.github.com/repos/ErpCloudSystem/tasks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ErpCloudSystem/tasks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ErpCloudSystem/tasks/git/refs{/sha}","trees_url":"https://api.github.com/repos/ErpCloudSystem/tasks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ErpCloudSystem/tasks/statuses/{sha}","languages_url":"https://api.github.com/repos/ErpCloudSystem/tasks/languages","stargazers_url":"https://api.github.com/repos/ErpCloudSystem/tasks/stargazers","contributors_url":"https://api.github.com/repos/ErpCloudSystem/tasks/contributors","subscribers_url":"https://api.github.com/repos/ErpCloudSystem/tasks/subscribers","subscription_url":"https://api.github.com/repos/ErpCloudSystem/tasks/subscription","commits_url":"https://api.github.com/repos/ErpCloudSystem/tasks/commits{/sha}","git_commits_url":"https://api.github.com/repos/ErpCloudSystem/tasks/git/commits{/sha}","comments_url":"https://api.github.com/repos/ErpCloudSystem/tasks/comments{/number}","issue_comment_url":"https://api.github.com/repos/ErpCloudSystem/tasks/issues/comments{/number}","contents_url":"https://api.github.com/repos/ErpCloudSystem/tasks/contents/{+path}","compare_url":"https://api.github.com/repos/ErpCloudSystem/tasks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ErpCloudSystem/tasks/merges","archive_url":"https://api.github.com/repos/ErpCloudSystem/tasks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ErpCloudSystem/tasks/downloads","issues_url":"https://api.github.com/repos/ErpCloudSystem/tasks/issues{/number}","pulls_url":"https://api.github.com/repos/ErpCloudSystem/tasks/pulls{/number}","milestones_url":"https://api.github.com/repos/ErpCloudSystem/tasks/milestones{/number}","notifications_url":"https://api.github.com/repos/ErpCloudSystem/tasks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ErpCloudSystem/tasks/labels{/name}","releases_url":"https://api.github.com/repos/ErpCloudSystem/tasks/releases{/id}","deployments_url":"https://api.github.com/repos/ErpCloudSystem/tasks/deployments","created_at":"2016-06-05T09:27:48Z","updated_at":"2016-06-15T13:01:44Z","pushed_at":"2016-08-03T18:23:34Z","git_url":"git://github.com/ErpCloudSystem/tasks.git","ssh_url":"git@github.com:ErpCloudSystem/tasks.git","clone_url":"https://github.com/ErpCloudSystem/tasks.git","svn_url":"https://github.com/ErpCloudSystem/tasks","homepage":null,"size":63,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"ErpCloudSystem:master","ref":"master","sha":"84d24103fa525a9f14d7a150f754dcc9dacb0018","user":{"login":"ErpCloudSystem","id":19682505,"avatar_url":"https://avatars.githubusercontent.com/u/19682505?v=3","gravatar_id":"","url":"https://api.github.com/users/ErpCloudSystem","html_url":"https://github.com/ErpCloudSystem","followers_url":"https://api.github.com/users/ErpCloudSystem/followers","following_url":"https://api.github.com/users/ErpCloudSystem/following{/other_user}","gists_url":"https://api.github.com/users/ErpCloudSystem/gists{/gist_id}","starred_url":"https://api.github.com/users/ErpCloudSystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ErpCloudSystem/subscriptions","organizations_url":"https://api.github.com/users/ErpCloudSystem/orgs","repos_url":"https://api.github.com/users/ErpCloudSystem/repos","events_url":"https://api.github.com/users/ErpCloudSystem/events{/privacy}","received_events_url":"https://api.github.com/users/ErpCloudSystem/received_events","type":"Organization","site_admin":false},"repo":{"id":60452557,"name":"tasks","full_name":"ErpCloudSystem/tasks","owner":{"login":"ErpCloudSystem","id":19682505,"avatar_url":"https://avatars.githubusercontent.com/u/19682505?v=3","gravatar_id":"","url":"https://api.github.com/users/ErpCloudSystem","html_url":"https://github.com/ErpCloudSystem","followers_url":"https://api.github.com/users/ErpCloudSystem/followers","following_url":"https://api.github.com/users/ErpCloudSystem/following{/other_user}","gists_url":"https://api.github.com/users/ErpCloudSystem/gists{/gist_id}","starred_url":"https://api.github.com/users/ErpCloudSystem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ErpCloudSystem/subscriptions","organizations_url":"https://api.github.com/users/ErpCloudSystem/orgs","repos_url":"https://api.github.com/users/ErpCloudSystem/repos","events_url":"https://api.github.com/users/ErpCloudSystem/events{/privacy}","received_events_url":"https://api.github.com/users/ErpCloudSystem/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ErpCloudSystem/tasks","description":"","fork":false,"url":"https://api.github.com/repos/ErpCloudSystem/tasks","forks_url":"https://api.github.com/repos/ErpCloudSystem/tasks/forks","keys_url":"https://api.github.com/repos/ErpCloudSystem/tasks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ErpCloudSystem/tasks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ErpCloudSystem/tasks/teams","hooks_url":"https://api.github.com/repos/ErpCloudSystem/tasks/hooks","issue_events_url":"https://api.github.com/repos/ErpCloudSystem/tasks/issues/events{/number}","events_url":"https://api.github.com/repos/ErpCloudSystem/tasks/events","assignees_url":"https://api.github.com/repos/ErpCloudSystem/tasks/assignees{/user}","branches_url":"https://api.github.com/repos/ErpCloudSystem/tasks/branches{/branch}","tags_url":"https://api.github.com/repos/ErpCloudSystem/tasks/tags","blobs_url":"https://api.github.com/repos/ErpCloudSystem/tasks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ErpCloudSystem/tasks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ErpCloudSystem/tasks/git/refs{/sha}","trees_url":"https://api.github.com/repos/ErpCloudSystem/tasks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ErpCloudSystem/tasks/statuses/{sha}","languages_url":"https://api.github.com/repos/ErpCloudSystem/tasks/languages","stargazers_url":"https://api.github.com/repos/ErpCloudSystem/tasks/stargazers","contributors_url":"https://api.github.com/repos/ErpCloudSystem/tasks/contributors","subscribers_url":"https://api.github.com/repos/ErpCloudSystem/tasks/subscribers","subscription_url":"https://api.github.com/repos/ErpCloudSystem/tasks/subscription","commits_url":"https://api.github.com/repos/ErpCloudSystem/tasks/commits{/sha}","git_commits_url":"https://api.github.com/repos/ErpCloudSystem/tasks/git/commits{/sha}","comments_url":"https://api.github.com/repos/ErpCloudSystem/tasks/comments{/number}","issue_comment_url":"https://api.github.com/repos/ErpCloudSystem/tasks/issues/comments{/number}","contents_url":"https://api.github.com/repos/ErpCloudSystem/tasks/contents/{+path}","compare_url":"https://api.github.com/repos/ErpCloudSystem/tasks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ErpCloudSystem/tasks/merges","archive_url":"https://api.github.com/repos/ErpCloudSystem/tasks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ErpCloudSystem/tasks/downloads","issues_url":"https://api.github.com/repos/ErpCloudSystem/tasks/issues{/number}","pulls_url":"https://api.github.com/repos/ErpCloudSystem/tasks/pulls{/number}","milestones_url":"https://api.github.com/repos/ErpCloudSystem/tasks/milestones{/number}","notifications_url":"https://api.github.com/repos/ErpCloudSystem/tasks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ErpCloudSystem/tasks/labels{/name}","releases_url":"https://api.github.com/repos/ErpCloudSystem/tasks/releases{/id}","deployments_url":"https://api.github.com/repos/ErpCloudSystem/tasks/deployments","created_at":"2016-06-05T09:27:48Z","updated_at":"2016-06-15T13:01:44Z","pushed_at":"2016-08-03T18:23:34Z","git_url":"git://github.com/ErpCloudSystem/tasks.git","ssh_url":"git@github.com:ErpCloudSystem/tasks.git","clone_url":"https://github.com/ErpCloudSystem/tasks.git","svn_url":"https://github.com/ErpCloudSystem/tasks","homepage":null,"size":63,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ErpCloudSystem/tasks/pulls/10"},"html":{"href":"https://github.com/ErpCloudSystem/tasks/pull/10"},"issue":{"href":"https://api.github.com/repos/ErpCloudSystem/tasks/issues/10"},"comments":{"href":"https://api.github.com/repos/ErpCloudSystem/tasks/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/ErpCloudSystem/tasks/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/ErpCloudSystem/tasks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ErpCloudSystem/tasks/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/ErpCloudSystem/tasks/statuses/2ea0bd7dc3f34d9a10ed3f208b07f7023ff36427"}}}}
{"actor":{"display_login":"bsnisar"}}