{"action":"created","comment":{"url":"https://api.github.com/repos/NunoLopes96/Licenciatura/pulls/comments/74333975","id":74333975,"diff_hunk":"@@ -0,0 +1,199 @@\n+package arvorebinaria;\r\n+public class ArvBin<E extends Comparable<? super E>> {\r\n+       \r\n+        NoABP<E> raiz = new NoABP<E>(null,null,null);\r\n+        \r\n+        public boolean isEmpty() {\r\n+        \treturn raiz.getElemento() == null;\r\n+        }\r\n+\r\n+        public boolean contains (E x) {\r\n+        \treturn contains(x, raiz);\r\n+        }\r\n+        \r\n+        private boolean contains (E x, NoABP<E> no) {\r\n+        \tif (no.getElemento() == null) {\r\n+        \t\treturn false;\r\n+        \t}\r\n+        \tif (no.getElemento().compareTo(x) == 0) {\r\n+        \t\treturn true;\r\n+        \t}\r\n+        \tif (no.getElemento().compareTo(x) < 0) {\r\n+        \t\treturn contains(x, no.getDir());\r\n+        \t}\r\n+        \tif (no.getElemento().compareTo(x) > 0) {\r\n+        \t\treturn contains(x, no.getEsq());\r\n+        \t}\r\n+        \treturn false;\r\n+        }\r\n+        \r\n+        public E find(E x) {\r\n+        \treturn find(x, raiz);\r\n+        }\r\n+\r\n+        private E find(E x, NoABP<E> no) {\r\n+        \tif (no.getElemento() == null) {\r\n+        \t\treturn null;\r\n+        \t}\r\n+        \tif (no.getElemento().compareTo(x) == 0) {\r\n+        \t\treturn no.getElemento();\r\n+        \t}\r\n+        \tif (no.getElemento().compareTo(x) < 0) {\r\n+        \t\treturn find(x, no.getDir());\r\n+        \t}\r\n+        \tif (no.getElemento().compareTo(x) > 0) {\r\n+        \t\treturn find(x, no.getEsq());\r\n+        \t}\r\n+        \treturn no.getElemento();\r\n+        }\r\n+        \r\n+        public E findMin() {\r\n+        \treturn findMin(raiz);\r\n+        }\r\n+        \r\n+        private E findMin(NoABP<E> no) {\r\n+        \tif (no.getEsq() == null) {\r\n+        \t\treturn no.getElemento();\r\n+        \t}\r\n+        \tif (no.getEsq().getElemento() != null) {\r\n+        \t\treturn findMin(no.getEsq());\r\n+        \t}\r\n+        \treturn (E) no.getElemento();\r\n+        }\r\n+\r\n+        public E findMax() {\r\n+        \treturn findMax(raiz);\r\n+        }\r\n+        \r\n+        private E findMax(NoABP<E> no) {\r\n+        \tif (no.getDir() == null) {\r\n+        \t\treturn no.getElemento();\r\n+        \t}\r\n+        \tif (no.getDir().getElemento() != null) {\r\n+        \t\treturn findMax(no.getDir());\r\n+        \t}\r\n+        \treturn (E) no.getElemento();\r\n+        }\r\n+       \r\n+        public void insere (E x) {\r\n+                insere(x,raiz);\r\n+        }\r\n+       \r\n+        private NoABP<E> insere(E x, NoABP<E> n) {\r\n+    \t\tif (n.getElemento() == null) {\r\n+            \tn.setElemento(x);\r\n+            \tn.setDir(new NoABP<E>(null,null,null));\r\n+            \tn.setEsq(new NoABP<E>(null,null,null));\r\n+            \treturn n;\r\n+            }\r\n+            else if ((n.getElemento()).compareTo(x)<0) {\r\n+            \tinsere(x, n.getDir());\r\n+            }\r\n+            else if ((n.getElemento()).compareTo(x)>0) {\r\n+            \tinsere(x, n.getEsq());\r\n+            }\r\n+            else if ((n.getElemento()).compareTo(x)==0) {\r\n+            \treturn null;\r\n+            }\r\n+            return n;\r\n+        }\r\n+       \r\n+       public void remove (E x) {\r\n+    \t   raiz = remove(x,raiz);\r\n+       }\r\n+       \r\n+       private NoABP<E> remove(E x, NoABP<E> n) {\r\n+        \tif (n == null) {\r\n+            \treturn n;\r\n+            }\r\n+            else if (n.getElemento().compareTo(x)<0) {\r\n+            \tremove(x, n.getDir());\r\n+            }\r\n+            else if (n.getElemento().compareTo(x)>0) {\r\n+            \tremove(x, n.getEsq());\r\n+            }\r\n+            else if ( n.getEsq().getElemento() != null && n.getDir().getElemento() != null ) // Two children\r\n+            {\r\n+                E min = findMin(n.getDir());\r\n+                n.setElemento(min);\r\n+                n.setDir(remove( min, n.getDir()));\r\n+            }\r\n+            else if (n.getEsq().getElemento() == null) {\r\n+            \tn = n.getDir();\r\n+            \tn.setDir(null);\r\n+            }\r\n+            else {\r\n+            \tn = n.getEsq();\r\n+            \tn.setEsq(null);\r\n+            }\r\n+            return n;\r\n+                \t\r\n+        }\r\n+       \t\r\n+        public String printEmOrdem() {\r\n+        \treturn printEmOrdem(raiz);\r\n+        }\r\n+        \r\n+        private String printEmOrdem(NoABP<E> no) {\r\n+        \tString a = \"\";\r\n+        \tif (no.getElemento() == null) { \r\n+        \t\treturn \"\";\r\n+        \t}\r\n+        \tif (no.getEsq() != null) {\r\n+        \t\ta+= printEmOrdem( no.getEsq() );\r\n+        \t}\r\n+        \t\r\n+        \ta += no.getElemento() + \"\\n\";\r\n+        \t\r\n+        \tif (no.getDir() != null) {\r\n+        \t\ta+= printEmOrdem( no.getDir() );\r\n+        \t}\r\n+        \t\r\n+        \treturn a;\r\n+        }\r\n+\r\n+        public String printPosOrdem() {\r\n+        \treturn printPosOrdem(raiz);\r\n+        }\r\n+        \r\n+        private String printPosOrdem(NoABP<E> no) {\r\n+        \tString a = \"\";\r","path":"EDA1/1ºTrabalho/src/arvorebinaria/ArvBin.java","position":160,"original_position":160,"commit_id":"5fcad17a306364191bce6aaa027fb0e13e3c44f1","original_commit_id":"5fcad17a306364191bce6aaa027fb0e13e3c44f1","user":{"login":"jreys","id":16468676,"avatar_url":"https://avatars.githubusercontent.com/u/16468676?v=3","gravatar_id":"","url":"https://api.github.com/users/jreys","html_url":"https://github.com/jreys","followers_url":"https://api.github.com/users/jreys/followers","following_url":"https://api.github.com/users/jreys/following{/other_user}","gists_url":"https://api.github.com/users/jreys/gists{/gist_id}","starred_url":"https://api.github.com/users/jreys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jreys/subscriptions","organizations_url":"https://api.github.com/users/jreys/orgs","repos_url":"https://api.github.com/users/jreys/repos","events_url":"https://api.github.com/users/jreys/events{/privacy}","received_events_url":"https://api.github.com/users/jreys/received_events","type":"User","site_admin":false},"body":"\\n","created_at":"2016-08-10T21:25:59Z","updated_at":"2016-08-10T21:25:59Z","html_url":"https://github.com/NunoLopes96/Licenciatura/pull/1#discussion_r74333975","pull_request_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/NunoLopes96/Licenciatura/pulls/comments/74333975"},"html":{"href":"https://github.com/NunoLopes96/Licenciatura/pull/1#discussion_r74333975"},"pull_request":{"href":"https://api.github.com/repos/NunoLopes96/Licenciatura/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/NunoLopes96/Licenciatura/pulls/1","id":80855074,"html_url":"https://github.com/NunoLopes96/Licenciatura/pull/1","diff_url":"https://github.com/NunoLopes96/Licenciatura/pull/1.diff","patch_url":"https://github.com/NunoLopes96/Licenciatura/pull/1.patch","issue_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/issues/1","number":1,"state":"open","locked":false,"title":"Adicionado primeiro trabalho de EDA1","user":{"login":"NunoLopes96","id":20955884,"avatar_url":"https://avatars.githubusercontent.com/u/20955884?v=3","gravatar_id":"","url":"https://api.github.com/users/NunoLopes96","html_url":"https://github.com/NunoLopes96","followers_url":"https://api.github.com/users/NunoLopes96/followers","following_url":"https://api.github.com/users/NunoLopes96/following{/other_user}","gists_url":"https://api.github.com/users/NunoLopes96/gists{/gist_id}","starred_url":"https://api.github.com/users/NunoLopes96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NunoLopes96/subscriptions","organizations_url":"https://api.github.com/users/NunoLopes96/orgs","repos_url":"https://api.github.com/users/NunoLopes96/repos","events_url":"https://api.github.com/users/NunoLopes96/events{/privacy}","received_events_url":"https://api.github.com/users/NunoLopes96/received_events","type":"User","site_admin":false},"body":"Ler Enunciado : Trab1_1516.pdf","created_at":"2016-08-10T19:44:08Z","updated_at":"2016-08-10T21:25:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d1e7cb87301adb0725f2bb2c23c020dc3caae80","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/pulls/1/commits","review_comments_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/pulls/1/comments","review_comment_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/issues/1/comments","statuses_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/statuses/5fcad17a306364191bce6aaa027fb0e13e3c44f1","head":{"label":"NunoLopes96:trab1","ref":"trab1","sha":"5fcad17a306364191bce6aaa027fb0e13e3c44f1","user":{"login":"NunoLopes96","id":20955884,"avatar_url":"https://avatars.githubusercontent.com/u/20955884?v=3","gravatar_id":"","url":"https://api.github.com/users/NunoLopes96","html_url":"https://github.com/NunoLopes96","followers_url":"https://api.github.com/users/NunoLopes96/followers","following_url":"https://api.github.com/users/NunoLopes96/following{/other_user}","gists_url":"https://api.github.com/users/NunoLopes96/gists{/gist_id}","starred_url":"https://api.github.com/users/NunoLopes96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NunoLopes96/subscriptions","organizations_url":"https://api.github.com/users/NunoLopes96/orgs","repos_url":"https://api.github.com/users/NunoLopes96/repos","events_url":"https://api.github.com/users/NunoLopes96/events{/privacy}","received_events_url":"https://api.github.com/users/NunoLopes96/received_events","type":"User","site_admin":false},"repo":{"id":65409056,"name":"Licenciatura","full_name":"NunoLopes96/Licenciatura","owner":{"login":"NunoLopes96","id":20955884,"avatar_url":"https://avatars.githubusercontent.com/u/20955884?v=3","gravatar_id":"","url":"https://api.github.com/users/NunoLopes96","html_url":"https://github.com/NunoLopes96","followers_url":"https://api.github.com/users/NunoLopes96/followers","following_url":"https://api.github.com/users/NunoLopes96/following{/other_user}","gists_url":"https://api.github.com/users/NunoLopes96/gists{/gist_id}","starred_url":"https://api.github.com/users/NunoLopes96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NunoLopes96/subscriptions","organizations_url":"https://api.github.com/users/NunoLopes96/orgs","repos_url":"https://api.github.com/users/NunoLopes96/repos","events_url":"https://api.github.com/users/NunoLopes96/events{/privacy}","received_events_url":"https://api.github.com/users/NunoLopes96/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/NunoLopes96/Licenciatura","description":"Trabalhos realizados durante a minha licenciatura em Engenharia Informática na Universidade de Évora","fork":false,"url":"https://api.github.com/repos/NunoLopes96/Licenciatura","forks_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/forks","keys_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/teams","hooks_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/hooks","issue_events_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/issues/events{/number}","events_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/events","assignees_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/assignees{/user}","branches_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/branches{/branch}","tags_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/tags","blobs_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/git/refs{/sha}","trees_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/statuses/{sha}","languages_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/languages","stargazers_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/stargazers","contributors_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/contributors","subscribers_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/subscribers","subscription_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/subscription","commits_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/commits{/sha}","git_commits_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/git/commits{/sha}","comments_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/comments{/number}","issue_comment_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/issues/comments{/number}","contents_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/contents/{+path}","compare_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/merges","archive_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/downloads","issues_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/issues{/number}","pulls_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/pulls{/number}","milestones_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/milestones{/number}","notifications_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/labels{/name}","releases_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/releases{/id}","deployments_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/deployments","created_at":"2016-08-10T19:04:17Z","updated_at":"2016-08-10T19:04:17Z","pushed_at":"2016-08-10T21:22:49Z","git_url":"git://github.com/NunoLopes96/Licenciatura.git","ssh_url":"git@github.com:NunoLopes96/Licenciatura.git","clone_url":"https://github.com/NunoLopes96/Licenciatura.git","svn_url":"https://github.com/NunoLopes96/Licenciatura","homepage":null,"size":159,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"NunoLopes96:master","ref":"master","sha":"c34690e5ba534f28e12ad4939077167b3aeec4d9","user":{"login":"NunoLopes96","id":20955884,"avatar_url":"https://avatars.githubusercontent.com/u/20955884?v=3","gravatar_id":"","url":"https://api.github.com/users/NunoLopes96","html_url":"https://github.com/NunoLopes96","followers_url":"https://api.github.com/users/NunoLopes96/followers","following_url":"https://api.github.com/users/NunoLopes96/following{/other_user}","gists_url":"https://api.github.com/users/NunoLopes96/gists{/gist_id}","starred_url":"https://api.github.com/users/NunoLopes96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NunoLopes96/subscriptions","organizations_url":"https://api.github.com/users/NunoLopes96/orgs","repos_url":"https://api.github.com/users/NunoLopes96/repos","events_url":"https://api.github.com/users/NunoLopes96/events{/privacy}","received_events_url":"https://api.github.com/users/NunoLopes96/received_events","type":"User","site_admin":false},"repo":{"id":65409056,"name":"Licenciatura","full_name":"NunoLopes96/Licenciatura","owner":{"login":"NunoLopes96","id":20955884,"avatar_url":"https://avatars.githubusercontent.com/u/20955884?v=3","gravatar_id":"","url":"https://api.github.com/users/NunoLopes96","html_url":"https://github.com/NunoLopes96","followers_url":"https://api.github.com/users/NunoLopes96/followers","following_url":"https://api.github.com/users/NunoLopes96/following{/other_user}","gists_url":"https://api.github.com/users/NunoLopes96/gists{/gist_id}","starred_url":"https://api.github.com/users/NunoLopes96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NunoLopes96/subscriptions","organizations_url":"https://api.github.com/users/NunoLopes96/orgs","repos_url":"https://api.github.com/users/NunoLopes96/repos","events_url":"https://api.github.com/users/NunoLopes96/events{/privacy}","received_events_url":"https://api.github.com/users/NunoLopes96/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/NunoLopes96/Licenciatura","description":"Trabalhos realizados durante a minha licenciatura em Engenharia Informática na Universidade de Évora","fork":false,"url":"https://api.github.com/repos/NunoLopes96/Licenciatura","forks_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/forks","keys_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/teams","hooks_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/hooks","issue_events_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/issues/events{/number}","events_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/events","assignees_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/assignees{/user}","branches_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/branches{/branch}","tags_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/tags","blobs_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/git/refs{/sha}","trees_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/statuses/{sha}","languages_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/languages","stargazers_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/stargazers","contributors_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/contributors","subscribers_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/subscribers","subscription_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/subscription","commits_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/commits{/sha}","git_commits_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/git/commits{/sha}","comments_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/comments{/number}","issue_comment_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/issues/comments{/number}","contents_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/contents/{+path}","compare_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/merges","archive_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/downloads","issues_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/issues{/number}","pulls_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/pulls{/number}","milestones_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/milestones{/number}","notifications_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/labels{/name}","releases_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/releases{/id}","deployments_url":"https://api.github.com/repos/NunoLopes96/Licenciatura/deployments","created_at":"2016-08-10T19:04:17Z","updated_at":"2016-08-10T19:04:17Z","pushed_at":"2016-08-10T21:22:49Z","git_url":"git://github.com/NunoLopes96/Licenciatura.git","ssh_url":"git@github.com:NunoLopes96/Licenciatura.git","clone_url":"https://github.com/NunoLopes96/Licenciatura.git","svn_url":"https://github.com/NunoLopes96/Licenciatura","homepage":null,"size":159,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NunoLopes96/Licenciatura/pulls/1"},"html":{"href":"https://github.com/NunoLopes96/Licenciatura/pull/1"},"issue":{"href":"https://api.github.com/repos/NunoLopes96/Licenciatura/issues/1"},"comments":{"href":"https://api.github.com/repos/NunoLopes96/Licenciatura/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/NunoLopes96/Licenciatura/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/NunoLopes96/Licenciatura/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NunoLopes96/Licenciatura/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/NunoLopes96/Licenciatura/statuses/5fcad17a306364191bce6aaa027fb0e13e3c44f1"}}}}
{"actor":{"display_login":"jreys"}}