{"action":"created","comment":{"url":"https://api.github.com/repos/miguelp1986/data-structures/pulls/comments/127375278","pull_request_review_id":49953677,"id":127375278,"diff_hunk":"@@ -0,0 +1,111 @@\n+Travis\n+[![Build Status](https://travis-ci.org/miguelp1986/data-structures.svg?branch=master)](https://travis-ci.org/miguelp1986/data-structures)\n+\n+\n+# Data Structures\n+By Miguel Pena and Ophelia Yin\n+\n+***Binary Search Tree***\n+\n+Implemented binary bearch tree with following methods: \n+```python\n+insert(self, val): \n+'''will insert the value val into the BST. If val is already present, it will be\n+ignored.'''\n+\n+search(self, val): \n+'''will return the node containing that value, else None'''\n+\n+size(self): \n+'''will return the integer size of the BST (equal to the total\n+number of values stored in the tree). It will return 0 if the tree is empty.'''\n+\n+depth(self): \n+'''will return an integer representing the total number of levels in\n+the tree. If there are no values, depth is 0, if one value the depth should be\n+1, if two values it will be 2, if three values it may be 2 or 3, depending,\n+etc.'''\n+\n+contains(self, val): \n+'''will return True if val is in the BST, False if not.'''\n+\n+balance(self): \n+'''will return an integer, positive or negative that represents how\n+well balanced the tree is. Trees which are higher on the left than the right\n+should return a positive value, trees which are higher on the right than the\n+left should return a negative value. An ideally-balanced tree should return 0.'''\n+\n+in_order(self): \n+'''will return a generator that will return the values in the tree using in-order traversal, one at a time.''' \n+\n+pre_order(self): \n+'''will return a generator that will return the values in the tree using pre-order traversal, one at a time.''' \n+\n+post_order(self): \n+'''will return a generator that will return the values in the tree using post_order traversal, one at a time.''' \n+\n+breadth_first(self): \n+'''will return a generator that will return the values in the tree using breadth-first traversal, one at a time.'''\n+\n+```\n+\n+delete(self):\n+'''delete a node and its value from a BST.'''\n+\n+_balance_of_subtree(self, node, balance=0):\n+\"\"\"Return integer that represents how balanced a subtree is.\n+Positive if left branch has greater depth, negative if right branch is greater,\n+and a balanced tree returns 0.\"\"\"\n+\n+\n+find_imbalanced_subtree(self, inserted_or_deleted_node):\n+\"\"\"Return node where the imbalanced subtree starts. Returns None if tree is balanced.\"\"\"\n+\n+\n+def rotate_left(self, old_node):\n+\"\"\"Helper function to perform left rotation on tree.\"\"\"\n+\n+\n+def rotate_right(self, old_node):\n+\"\"\"Helper function to perform right rotation on tree.\"\"\"\n+\n+\n+def rebalance(self, node):\n+\"\"\"Helper function to perform rebalance on tree after insert and delete.\"\"\"\n+\n+\n+***Hash Table Search***\n+\n+Implemented hash tree with following methods: \n+We use a list, not the most efficient method, but it works and it is simple.\n+\n+\n+def get(self, key):\n+\"\"\"Return the value stored with given key.\"\"\"\n+\n+\n+def set(self, key, val):\n+\"\"\"Store given val with given key.\"\"\"\n+\n+\n+def _hash(self, key):","path":"README.md","position":null,"original_position":91,"commit_id":"3864c73ba3b611cbc23b2522f678632b43bbb133","original_commit_id":"cc8d2853abd9ea94a7c73c2544856eb4db4bf1b4","user":{"login":"miguelp1986","id":15747611,"avatar_url":"https://avatars2.githubusercontent.com/u/15747611?v=4","gravatar_id":"","url":"https://api.github.com/users/miguelp1986","html_url":"https://github.com/miguelp1986","followers_url":"https://api.github.com/users/miguelp1986/followers","following_url":"https://api.github.com/users/miguelp1986/following{/other_user}","gists_url":"https://api.github.com/users/miguelp1986/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelp1986/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelp1986/subscriptions","organizations_url":"https://api.github.com/users/miguelp1986/orgs","repos_url":"https://api.github.com/users/miguelp1986/repos","events_url":"https://api.github.com/users/miguelp1986/events{/privacy}","received_events_url":"https://api.github.com/users/miguelp1986/received_events","type":"User","site_admin":false},"body":"Done and done","created_at":"2017-07-14T02:46:45Z","updated_at":"2017-07-14T02:46:45Z","html_url":"https://github.com/miguelp1986/data-structures/pull/7#discussion_r127375278","pull_request_url":"https://api.github.com/repos/miguelp1986/data-structures/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/miguelp1986/data-structures/pulls/comments/127375278"},"html":{"href":"https://github.com/miguelp1986/data-structures/pull/7#discussion_r127375278"},"pull_request":{"href":"https://api.github.com/repos/miguelp1986/data-structures/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/miguelp1986/data-structures/pulls/7","id":129510343,"html_url":"https://github.com/miguelp1986/data-structures/pull/7","diff_url":"https://github.com/miguelp1986/data-structures/pull/7.diff","patch_url":"https://github.com/miguelp1986/data-structures/pull/7.patch","issue_url":"https://api.github.com/repos/miguelp1986/data-structures/issues/7","number":7,"state":"open","locked":false,"title":"Hash","user":{"login":"owy1","id":17318689,"avatar_url":"https://avatars7.githubusercontent.com/u/17318689?v=4","gravatar_id":"","url":"https://api.github.com/users/owy1","html_url":"https://github.com/owy1","followers_url":"https://api.github.com/users/owy1/followers","following_url":"https://api.github.com/users/owy1/following{/other_user}","gists_url":"https://api.github.com/users/owy1/gists{/gist_id}","starred_url":"https://api.github.com/users/owy1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owy1/subscriptions","organizations_url":"https://api.github.com/users/owy1/orgs","repos_url":"https://api.github.com/users/owy1/repos","events_url":"https://api.github.com/users/owy1/events{/privacy}","received_events_url":"https://api.github.com/users/owy1/received_events","type":"User","site_admin":false},"body":"add hash table and simple tests, may add more tests when resource permit","created_at":"2017-07-08T00:53:14Z","updated_at":"2017-07-14T02:46:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5d277776babb22924427f6f4f7a569551465cabf","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/miguelp1986/data-structures/pulls/7/commits","review_comments_url":"https://api.github.com/repos/miguelp1986/data-structures/pulls/7/comments","review_comment_url":"https://api.github.com/repos/miguelp1986/data-structures/pulls/comments{/number}","comments_url":"https://api.github.com/repos/miguelp1986/data-structures/issues/7/comments","statuses_url":"https://api.github.com/repos/miguelp1986/data-structures/statuses/3864c73ba3b611cbc23b2522f678632b43bbb133","head":{"label":"miguelp1986:hash","ref":"hash","sha":"3864c73ba3b611cbc23b2522f678632b43bbb133","user":{"login":"miguelp1986","id":15747611,"avatar_url":"https://avatars2.githubusercontent.com/u/15747611?v=4","gravatar_id":"","url":"https://api.github.com/users/miguelp1986","html_url":"https://github.com/miguelp1986","followers_url":"https://api.github.com/users/miguelp1986/followers","following_url":"https://api.github.com/users/miguelp1986/following{/other_user}","gists_url":"https://api.github.com/users/miguelp1986/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelp1986/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelp1986/subscriptions","organizations_url":"https://api.github.com/users/miguelp1986/orgs","repos_url":"https://api.github.com/users/miguelp1986/repos","events_url":"https://api.github.com/users/miguelp1986/events{/privacy}","received_events_url":"https://api.github.com/users/miguelp1986/received_events","type":"User","site_admin":false},"repo":{"id":94816472,"name":"data-structures","full_name":"miguelp1986/data-structures","owner":{"login":"miguelp1986","id":15747611,"avatar_url":"https://avatars2.githubusercontent.com/u/15747611?v=4","gravatar_id":"","url":"https://api.github.com/users/miguelp1986","html_url":"https://github.com/miguelp1986","followers_url":"https://api.github.com/users/miguelp1986/followers","following_url":"https://api.github.com/users/miguelp1986/following{/other_user}","gists_url":"https://api.github.com/users/miguelp1986/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelp1986/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelp1986/subscriptions","organizations_url":"https://api.github.com/users/miguelp1986/orgs","repos_url":"https://api.github.com/users/miguelp1986/repos","events_url":"https://api.github.com/users/miguelp1986/events{/privacy}","received_events_url":"https://api.github.com/users/miguelp1986/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/miguelp1986/data-structures","description":null,"fork":false,"url":"https://api.github.com/repos/miguelp1986/data-structures","forks_url":"https://api.github.com/repos/miguelp1986/data-structures/forks","keys_url":"https://api.github.com/repos/miguelp1986/data-structures/keys{/key_id}","collaborators_url":"https://api.github.com/repos/miguelp1986/data-structures/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/miguelp1986/data-structures/teams","hooks_url":"https://api.github.com/repos/miguelp1986/data-structures/hooks","issue_events_url":"https://api.github.com/repos/miguelp1986/data-structures/issues/events{/number}","events_url":"https://api.github.com/repos/miguelp1986/data-structures/events","assignees_url":"https://api.github.com/repos/miguelp1986/data-structures/assignees{/user}","branches_url":"https://api.github.com/repos/miguelp1986/data-structures/branches{/branch}","tags_url":"https://api.github.com/repos/miguelp1986/data-structures/tags","blobs_url":"https://api.github.com/repos/miguelp1986/data-structures/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/miguelp1986/data-structures/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/miguelp1986/data-structures/git/refs{/sha}","trees_url":"https://api.github.com/repos/miguelp1986/data-structures/git/trees{/sha}","statuses_url":"https://api.github.com/repos/miguelp1986/data-structures/statuses/{sha}","languages_url":"https://api.github.com/repos/miguelp1986/data-structures/languages","stargazers_url":"https://api.github.com/repos/miguelp1986/data-structures/stargazers","contributors_url":"https://api.github.com/repos/miguelp1986/data-structures/contributors","subscribers_url":"https://api.github.com/repos/miguelp1986/data-structures/subscribers","subscription_url":"https://api.github.com/repos/miguelp1986/data-structures/subscription","commits_url":"https://api.github.com/repos/miguelp1986/data-structures/commits{/sha}","git_commits_url":"https://api.github.com/repos/miguelp1986/data-structures/git/commits{/sha}","comments_url":"https://api.github.com/repos/miguelp1986/data-structures/comments{/number}","issue_comment_url":"https://api.github.com/repos/miguelp1986/data-structures/issues/comments{/number}","contents_url":"https://api.github.com/repos/miguelp1986/data-structures/contents/{+path}","compare_url":"https://api.github.com/repos/miguelp1986/data-structures/compare/{base}...{head}","merges_url":"https://api.github.com/repos/miguelp1986/data-structures/merges","archive_url":"https://api.github.com/repos/miguelp1986/data-structures/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/miguelp1986/data-structures/downloads","issues_url":"https://api.github.com/repos/miguelp1986/data-structures/issues{/number}","pulls_url":"https://api.github.com/repos/miguelp1986/data-structures/pulls{/number}","milestones_url":"https://api.github.com/repos/miguelp1986/data-structures/milestones{/number}","notifications_url":"https://api.github.com/repos/miguelp1986/data-structures/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/miguelp1986/data-structures/labels{/name}","releases_url":"https://api.github.com/repos/miguelp1986/data-structures/releases{/id}","deployments_url":"https://api.github.com/repos/miguelp1986/data-structures/deployments","created_at":"2017-06-19T20:07:59Z","updated_at":"2017-07-12T23:04:33Z","pushed_at":"2017-07-14T02:46:18Z","git_url":"git://github.com/miguelp1986/data-structures.git","ssh_url":"git@github.com:miguelp1986/data-structures.git","clone_url":"https://github.com/miguelp1986/data-structures.git","svn_url":"https://github.com/miguelp1986/data-structures","homepage":null,"size":790,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"miguelp1986:master","ref":"master","sha":"8acbaa86de1b355aaaeb92361c58549f3dd6ee07","user":{"login":"miguelp1986","id":15747611,"avatar_url":"https://avatars2.githubusercontent.com/u/15747611?v=4","gravatar_id":"","url":"https://api.github.com/users/miguelp1986","html_url":"https://github.com/miguelp1986","followers_url":"https://api.github.com/users/miguelp1986/followers","following_url":"https://api.github.com/users/miguelp1986/following{/other_user}","gists_url":"https://api.github.com/users/miguelp1986/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelp1986/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelp1986/subscriptions","organizations_url":"https://api.github.com/users/miguelp1986/orgs","repos_url":"https://api.github.com/users/miguelp1986/repos","events_url":"https://api.github.com/users/miguelp1986/events{/privacy}","received_events_url":"https://api.github.com/users/miguelp1986/received_events","type":"User","site_admin":false},"repo":{"id":94816472,"name":"data-structures","full_name":"miguelp1986/data-structures","owner":{"login":"miguelp1986","id":15747611,"avatar_url":"https://avatars2.githubusercontent.com/u/15747611?v=4","gravatar_id":"","url":"https://api.github.com/users/miguelp1986","html_url":"https://github.com/miguelp1986","followers_url":"https://api.github.com/users/miguelp1986/followers","following_url":"https://api.github.com/users/miguelp1986/following{/other_user}","gists_url":"https://api.github.com/users/miguelp1986/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelp1986/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelp1986/subscriptions","organizations_url":"https://api.github.com/users/miguelp1986/orgs","repos_url":"https://api.github.com/users/miguelp1986/repos","events_url":"https://api.github.com/users/miguelp1986/events{/privacy}","received_events_url":"https://api.github.com/users/miguelp1986/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/miguelp1986/data-structures","description":null,"fork":false,"url":"https://api.github.com/repos/miguelp1986/data-structures","forks_url":"https://api.github.com/repos/miguelp1986/data-structures/forks","keys_url":"https://api.github.com/repos/miguelp1986/data-structures/keys{/key_id}","collaborators_url":"https://api.github.com/repos/miguelp1986/data-structures/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/miguelp1986/data-structures/teams","hooks_url":"https://api.github.com/repos/miguelp1986/data-structures/hooks","issue_events_url":"https://api.github.com/repos/miguelp1986/data-structures/issues/events{/number}","events_url":"https://api.github.com/repos/miguelp1986/data-structures/events","assignees_url":"https://api.github.com/repos/miguelp1986/data-structures/assignees{/user}","branches_url":"https://api.github.com/repos/miguelp1986/data-structures/branches{/branch}","tags_url":"https://api.github.com/repos/miguelp1986/data-structures/tags","blobs_url":"https://api.github.com/repos/miguelp1986/data-structures/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/miguelp1986/data-structures/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/miguelp1986/data-structures/git/refs{/sha}","trees_url":"https://api.github.com/repos/miguelp1986/data-structures/git/trees{/sha}","statuses_url":"https://api.github.com/repos/miguelp1986/data-structures/statuses/{sha}","languages_url":"https://api.github.com/repos/miguelp1986/data-structures/languages","stargazers_url":"https://api.github.com/repos/miguelp1986/data-structures/stargazers","contributors_url":"https://api.github.com/repos/miguelp1986/data-structures/contributors","subscribers_url":"https://api.github.com/repos/miguelp1986/data-structures/subscribers","subscription_url":"https://api.github.com/repos/miguelp1986/data-structures/subscription","commits_url":"https://api.github.com/repos/miguelp1986/data-structures/commits{/sha}","git_commits_url":"https://api.github.com/repos/miguelp1986/data-structures/git/commits{/sha}","comments_url":"https://api.github.com/repos/miguelp1986/data-structures/comments{/number}","issue_comment_url":"https://api.github.com/repos/miguelp1986/data-structures/issues/comments{/number}","contents_url":"https://api.github.com/repos/miguelp1986/data-structures/contents/{+path}","compare_url":"https://api.github.com/repos/miguelp1986/data-structures/compare/{base}...{head}","merges_url":"https://api.github.com/repos/miguelp1986/data-structures/merges","archive_url":"https://api.github.com/repos/miguelp1986/data-structures/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/miguelp1986/data-structures/downloads","issues_url":"https://api.github.com/repos/miguelp1986/data-structures/issues{/number}","pulls_url":"https://api.github.com/repos/miguelp1986/data-structures/pulls{/number}","milestones_url":"https://api.github.com/repos/miguelp1986/data-structures/milestones{/number}","notifications_url":"https://api.github.com/repos/miguelp1986/data-structures/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/miguelp1986/data-structures/labels{/name}","releases_url":"https://api.github.com/repos/miguelp1986/data-structures/releases{/id}","deployments_url":"https://api.github.com/repos/miguelp1986/data-structures/deployments","created_at":"2017-06-19T20:07:59Z","updated_at":"2017-07-12T23:04:33Z","pushed_at":"2017-07-14T02:46:18Z","git_url":"git://github.com/miguelp1986/data-structures.git","ssh_url":"git@github.com:miguelp1986/data-structures.git","clone_url":"https://github.com/miguelp1986/data-structures.git","svn_url":"https://github.com/miguelp1986/data-structures","homepage":null,"size":790,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/miguelp1986/data-structures/pulls/7"},"html":{"href":"https://github.com/miguelp1986/data-structures/pull/7"},"issue":{"href":"https://api.github.com/repos/miguelp1986/data-structures/issues/7"},"comments":{"href":"https://api.github.com/repos/miguelp1986/data-structures/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/miguelp1986/data-structures/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/miguelp1986/data-structures/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/miguelp1986/data-structures/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/miguelp1986/data-structures/statuses/3864c73ba3b611cbc23b2522f678632b43bbb133"}}}}
{"actor":{"display_login":"miguelp1986"}}