{"action":"created","comment":{"url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/pulls/comments/96779349","pull_request_review_id":17371544,"id":96779349,"diff_hunk":"@@ -0,0 +1,129 @@\n+class Node {\n+  constructor() {\n+    this.data\n+    this.next = null\n+  }\n+}\n+\n+class LinkedList {\n+  constructor() {\n+    this.head = null\n+    this.tail = null\n+  }\n+\n+  getHeadNode() {\n+    return this.head\n+  }\n+\n+  getTailNode() {\n+    return this.tail\n+  }\n+\n+  contains(element) {\n+    let elementFound = false\n+    let iterator = this.head\n+    while(iterator) {\n+      if(iterator.data === element) elementFound = true\n+      iterator = iterator.next\n+    }\n+    return elementFound\n+  }\n+\n+  find(element) {\n+    let iterator = this.head\n+    while(iterator) {\n+      if(iterator.data === element) return iterator\n+      iterator = iterator.next\n+    }\n+    return -1\n+  }\n+\n+  insert(element) {\n+    let tail = new Node()\n+    tail.data = element\n+    if(this.head == null) this.head = tail\n+    if(this.tail != null) this.tail.next = tail\n+\n+    this.tail = tail\n+\n+  }\n+\n+  insertFirst(element) {\n+    let head = new Node()\n+    head.data = element\n+    head.next = this.head\n+    this.head = head\n+  }\n+\n+  insertBefore(match,element) {\n+    let insertNode = new Node()\n+    insertNode.data = element\n+\n+    let matchNode = this.head\n+    while(matchNode.data !== match && matchNode) matchNode = matchNode.next\n+\n+    insertNode.next = matchNode.next\n+    matchNode.next = insertNode\n+\n+    if(this.head == matchNode) this.head = insertNode\n+  }\n+\n+  insertAfter(match,element) {\n+    let insertNode = new Node()\n+    insertNode.data = element\n+\n+    let matchNode = this.head\n+    let previous = null\n+    while(matchNode.data !== match && matchNode){\n+      previous = matchNode\n+      matchNode = matchNode.next\n+    }\n+\n+    insertNode.next = matchNode\n+    previous.next = insertNode\n+\n+    if(this.tail == matchNode) this.tail = insertNode\n+  }\n+\n+  remove() {\n+    let iterator = this.head\n+    while(iterator.next != this.tail) iterator = iterator.next\n+    iterator.next = null\n+    this.tail = iterator\n+  }\n+\n+  removeFirst() {\n+    this.head = this.head.next","path":"src/LinkedList.js","position":96,"original_position":96,"commit_id":"0e0390c6bda6251634838ba5690f5c542de7950f","original_commit_id":"0e0390c6bda6251634838ba5690f5c542de7950f","user":{"login":"deonna","id":20684747,"avatar_url":"https://avatars.githubusercontent.com/u/20684747?v=3","gravatar_id":"","url":"https://api.github.com/users/deonna","html_url":"https://github.com/deonna","followers_url":"https://api.github.com/users/deonna/followers","following_url":"https://api.github.com/users/deonna/following{/other_user}","gists_url":"https://api.github.com/users/deonna/gists{/gist_id}","starred_url":"https://api.github.com/users/deonna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deonna/subscriptions","organizations_url":"https://api.github.com/users/deonna/orgs","repos_url":"https://api.github.com/users/deonna/repos","events_url":"https://api.github.com/users/deonna/events{/privacy}","received_events_url":"https://api.github.com/users/deonna/received_events","type":"User","site_admin":false},"body":"What if `this.head` doesn't exist?","created_at":"2017-01-19T02:09:38Z","updated_at":"2017-01-19T02:09:38Z","html_url":"https://github.com/AdamB37/Core-Data-Structures/pull/2#discussion_r96779349","pull_request_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/AdamB37/Core-Data-Structures/pulls/comments/96779349"},"html":{"href":"https://github.com/AdamB37/Core-Data-Structures/pull/2#discussion_r96779349"},"pull_request":{"href":"https://api.github.com/repos/AdamB37/Core-Data-Structures/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/pulls/2","id":102167594,"html_url":"https://github.com/AdamB37/Core-Data-Structures/pull/2","diff_url":"https://github.com/AdamB37/Core-Data-Structures/pull/2.diff","patch_url":"https://github.com/AdamB37/Core-Data-Structures/pull/2.patch","issue_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/issues/2","number":2,"state":"open","locked":false,"title":"Priority queue","user":{"login":"asantos3026","id":12879025,"avatar_url":"https://avatars.githubusercontent.com/u/12879025?v=3","gravatar_id":"","url":"https://api.github.com/users/asantos3026","html_url":"https://github.com/asantos3026","followers_url":"https://api.github.com/users/asantos3026/followers","following_url":"https://api.github.com/users/asantos3026/following{/other_user}","gists_url":"https://api.github.com/users/asantos3026/gists{/gist_id}","starred_url":"https://api.github.com/users/asantos3026/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asantos3026/subscriptions","organizations_url":"https://api.github.com/users/asantos3026/orgs","repos_url":"https://api.github.com/users/asantos3026/repos","events_url":"https://api.github.com/users/asantos3026/events{/privacy}","received_events_url":"https://api.github.com/users/asantos3026/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-01-18T22:55:50Z","updated_at":"2017-01-19T02:09:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3994d14c82bb04cca5964bfee1be22403bbe4c8a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/pulls/2/commits","review_comments_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/pulls/2/comments","review_comment_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/issues/2/comments","statuses_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/statuses/0e0390c6bda6251634838ba5690f5c542de7950f","head":{"label":"AdamB37:priority-queue","ref":"priority-queue","sha":"0e0390c6bda6251634838ba5690f5c542de7950f","user":{"login":"AdamB37","id":20850898,"avatar_url":"https://avatars.githubusercontent.com/u/20850898?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamB37","html_url":"https://github.com/AdamB37","followers_url":"https://api.github.com/users/AdamB37/followers","following_url":"https://api.github.com/users/AdamB37/following{/other_user}","gists_url":"https://api.github.com/users/AdamB37/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamB37/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamB37/subscriptions","organizations_url":"https://api.github.com/users/AdamB37/orgs","repos_url":"https://api.github.com/users/AdamB37/repos","events_url":"https://api.github.com/users/AdamB37/events{/privacy}","received_events_url":"https://api.github.com/users/AdamB37/received_events","type":"User","site_admin":false},"repo":{"id":79272726,"name":"Core-Data-Structures","full_name":"AdamB37/Core-Data-Structures","owner":{"login":"AdamB37","id":20850898,"avatar_url":"https://avatars.githubusercontent.com/u/20850898?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamB37","html_url":"https://github.com/AdamB37","followers_url":"https://api.github.com/users/AdamB37/followers","following_url":"https://api.github.com/users/AdamB37/following{/other_user}","gists_url":"https://api.github.com/users/AdamB37/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamB37/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamB37/subscriptions","organizations_url":"https://api.github.com/users/AdamB37/orgs","repos_url":"https://api.github.com/users/AdamB37/repos","events_url":"https://api.github.com/users/AdamB37/events{/privacy}","received_events_url":"https://api.github.com/users/AdamB37/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AdamB37/Core-Data-Structures","description":null,"fork":false,"url":"https://api.github.com/repos/AdamB37/Core-Data-Structures","forks_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/forks","keys_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/teams","hooks_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/hooks","issue_events_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/issues/events{/number}","events_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/events","assignees_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/assignees{/user}","branches_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/branches{/branch}","tags_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/tags","blobs_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/git/refs{/sha}","trees_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/statuses/{sha}","languages_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/languages","stargazers_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/stargazers","contributors_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/contributors","subscribers_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/subscribers","subscription_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/subscription","commits_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/commits{/sha}","git_commits_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/git/commits{/sha}","comments_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/comments{/number}","issue_comment_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/issues/comments{/number}","contents_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/contents/{+path}","compare_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/merges","archive_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/downloads","issues_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/issues{/number}","pulls_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/pulls{/number}","milestones_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/milestones{/number}","notifications_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/labels{/name}","releases_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/releases{/id}","deployments_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/deployments","created_at":"2017-01-17T21:17:19Z","updated_at":"2017-01-17T21:21:12Z","pushed_at":"2017-01-19T00:34:27Z","git_url":"git://github.com/AdamB37/Core-Data-Structures.git","ssh_url":"git@github.com:AdamB37/Core-Data-Structures.git","clone_url":"https://github.com/AdamB37/Core-Data-Structures.git","svn_url":"https://github.com/AdamB37/Core-Data-Structures","homepage":null,"size":23,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"AdamB37:master","ref":"master","sha":"026788867effe6d72e41178682d7685bc8c74e4b","user":{"login":"AdamB37","id":20850898,"avatar_url":"https://avatars.githubusercontent.com/u/20850898?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamB37","html_url":"https://github.com/AdamB37","followers_url":"https://api.github.com/users/AdamB37/followers","following_url":"https://api.github.com/users/AdamB37/following{/other_user}","gists_url":"https://api.github.com/users/AdamB37/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamB37/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamB37/subscriptions","organizations_url":"https://api.github.com/users/AdamB37/orgs","repos_url":"https://api.github.com/users/AdamB37/repos","events_url":"https://api.github.com/users/AdamB37/events{/privacy}","received_events_url":"https://api.github.com/users/AdamB37/received_events","type":"User","site_admin":false},"repo":{"id":79272726,"name":"Core-Data-Structures","full_name":"AdamB37/Core-Data-Structures","owner":{"login":"AdamB37","id":20850898,"avatar_url":"https://avatars.githubusercontent.com/u/20850898?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamB37","html_url":"https://github.com/AdamB37","followers_url":"https://api.github.com/users/AdamB37/followers","following_url":"https://api.github.com/users/AdamB37/following{/other_user}","gists_url":"https://api.github.com/users/AdamB37/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamB37/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamB37/subscriptions","organizations_url":"https://api.github.com/users/AdamB37/orgs","repos_url":"https://api.github.com/users/AdamB37/repos","events_url":"https://api.github.com/users/AdamB37/events{/privacy}","received_events_url":"https://api.github.com/users/AdamB37/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AdamB37/Core-Data-Structures","description":null,"fork":false,"url":"https://api.github.com/repos/AdamB37/Core-Data-Structures","forks_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/forks","keys_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/teams","hooks_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/hooks","issue_events_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/issues/events{/number}","events_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/events","assignees_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/assignees{/user}","branches_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/branches{/branch}","tags_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/tags","blobs_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/git/refs{/sha}","trees_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/statuses/{sha}","languages_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/languages","stargazers_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/stargazers","contributors_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/contributors","subscribers_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/subscribers","subscription_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/subscription","commits_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/commits{/sha}","git_commits_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/git/commits{/sha}","comments_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/comments{/number}","issue_comment_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/issues/comments{/number}","contents_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/contents/{+path}","compare_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/merges","archive_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/downloads","issues_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/issues{/number}","pulls_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/pulls{/number}","milestones_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/milestones{/number}","notifications_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/labels{/name}","releases_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/releases{/id}","deployments_url":"https://api.github.com/repos/AdamB37/Core-Data-Structures/deployments","created_at":"2017-01-17T21:17:19Z","updated_at":"2017-01-17T21:21:12Z","pushed_at":"2017-01-19T00:34:27Z","git_url":"git://github.com/AdamB37/Core-Data-Structures.git","ssh_url":"git@github.com:AdamB37/Core-Data-Structures.git","clone_url":"https://github.com/AdamB37/Core-Data-Structures.git","svn_url":"https://github.com/AdamB37/Core-Data-Structures","homepage":null,"size":23,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AdamB37/Core-Data-Structures/pulls/2"},"html":{"href":"https://github.com/AdamB37/Core-Data-Structures/pull/2"},"issue":{"href":"https://api.github.com/repos/AdamB37/Core-Data-Structures/issues/2"},"comments":{"href":"https://api.github.com/repos/AdamB37/Core-Data-Structures/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/AdamB37/Core-Data-Structures/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/AdamB37/Core-Data-Structures/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AdamB37/Core-Data-Structures/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/AdamB37/Core-Data-Structures/statuses/0e0390c6bda6251634838ba5690f5c542de7950f"}}}}
{"actor":{"display_login":"deonna"}}