{"action":"created","comment":{"url":"https://api.github.com/repos/wilson0xb4/data-structures/pulls/comments/34310035","id":34310035,"diff_hunk":"@@ -87,3 +87,60 @@ def adjacent(self, n1, n2):\n         if n1 not in self.graph or n2 not in self.graph:\n             raise IndexError('Adjacent: At least one node not found.')\n         return n2 in self.graph[n1]\n+\n+    def depth_first_traversal(self, start):\n+        \"\"\"Perform a full depth first traversal of the graph starting\n+        at 'start'.\n+\n+        Return the full visited path when the traversal is complete\n+        as a list.\n+        \"\"\"\n+        path = []\n+        queue = [start]\n+\n+        while queue:\n+            node = queue.pop(0)\n+            if node not in path:\n+                path.append(node)\n+                queue = self.neighbors(node) + queue\n+        return path\n+\n+    def breadth_first_traversal(self, start):\n+        \"\"\"Perform a full breadth first traversal of the graph starting\n+        at 'start'.\n+\n+        Return the full visited path when the traversal is complete\n+        as a list.\n+        \"\"\"\n+        path = []\n+        queue = [start]\n+\n+        while queue:\n+            node = queue.pop(0)","path":"simple_graph.py","position":33,"original_position":33,"commit_id":"ddf543d1ced1f31c06f777ae5bd9a088493f355e","original_commit_id":"ddf543d1ced1f31c06f777ae5bd9a088493f355e","user":{"login":"Jakeand3rson","id":4807654,"avatar_url":"https://avatars.githubusercontent.com/u/4807654?v=3","gravatar_id":"","url":"https://api.github.com/users/Jakeand3rson","html_url":"https://github.com/Jakeand3rson","followers_url":"https://api.github.com/users/Jakeand3rson/followers","following_url":"https://api.github.com/users/Jakeand3rson/following{/other_user}","gists_url":"https://api.github.com/users/Jakeand3rson/gists{/gist_id}","starred_url":"https://api.github.com/users/Jakeand3rson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jakeand3rson/subscriptions","organizations_url":"https://api.github.com/users/Jakeand3rson/orgs","repos_url":"https://api.github.com/users/Jakeand3rson/repos","events_url":"https://api.github.com/users/Jakeand3rson/events{/privacy}","received_events_url":"https://api.github.com/users/Jakeand3rson/received_events","type":"User","site_admin":false},"body":"Same as before.","created_at":"2015-07-09T22:13:21Z","updated_at":"2015-07-09T22:13:21Z","html_url":"https://github.com/wilson0xb4/data-structures/pull/14#discussion_r34310035","pull_request_url":"https://api.github.com/repos/wilson0xb4/data-structures/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/wilson0xb4/data-structures/pulls/comments/34310035"},"html":{"href":"https://github.com/wilson0xb4/data-structures/pull/14#discussion_r34310035"},"pull_request":{"href":"https://api.github.com/repos/wilson0xb4/data-structures/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/wilson0xb4/data-structures/pulls/14","id":39631987,"html_url":"https://github.com/wilson0xb4/data-structures/pull/14","diff_url":"https://github.com/wilson0xb4/data-structures/pull/14.diff","patch_url":"https://github.com/wilson0xb4/data-structures/pull/14.patch","issue_url":"https://api.github.com/repos/wilson0xb4/data-structures/issues/14","number":14,"state":"closed","locked":false,"title":"add df and bf graph traversals","user":{"login":"wilson0xb4","id":1644683,"avatar_url":"https://avatars.githubusercontent.com/u/1644683?v=3","gravatar_id":"","url":"https://api.github.com/users/wilson0xb4","html_url":"https://github.com/wilson0xb4","followers_url":"https://api.github.com/users/wilson0xb4/followers","following_url":"https://api.github.com/users/wilson0xb4/following{/other_user}","gists_url":"https://api.github.com/users/wilson0xb4/gists{/gist_id}","starred_url":"https://api.github.com/users/wilson0xb4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilson0xb4/subscriptions","organizations_url":"https://api.github.com/users/wilson0xb4/orgs","repos_url":"https://api.github.com/users/wilson0xb4/repos","events_url":"https://api.github.com/users/wilson0xb4/events{/privacy}","received_events_url":"https://api.github.com/users/wilson0xb4/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-09T21:46:27Z","updated_at":"2015-07-09T22:13:21Z","closed_at":"2015-07-09T21:48:18Z","merged_at":"2015-07-09T21:48:18Z","merge_commit_sha":"6be98c32fbd3973786ee49bd39c5a3f63ec35f63","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wilson0xb4/data-structures/pulls/14/commits","review_comments_url":"https://api.github.com/repos/wilson0xb4/data-structures/pulls/14/comments","review_comment_url":"https://api.github.com/repos/wilson0xb4/data-structures/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wilson0xb4/data-structures/issues/14/comments","statuses_url":"https://api.github.com/repos/wilson0xb4/data-structures/statuses/ddf543d1ced1f31c06f777ae5bd9a088493f355e","head":{"label":"wilson0xb4:graph-traversal","ref":"graph-traversal","sha":"ddf543d1ced1f31c06f777ae5bd9a088493f355e","user":{"login":"wilson0xb4","id":1644683,"avatar_url":"https://avatars.githubusercontent.com/u/1644683?v=3","gravatar_id":"","url":"https://api.github.com/users/wilson0xb4","html_url":"https://github.com/wilson0xb4","followers_url":"https://api.github.com/users/wilson0xb4/followers","following_url":"https://api.github.com/users/wilson0xb4/following{/other_user}","gists_url":"https://api.github.com/users/wilson0xb4/gists{/gist_id}","starred_url":"https://api.github.com/users/wilson0xb4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilson0xb4/subscriptions","organizations_url":"https://api.github.com/users/wilson0xb4/orgs","repos_url":"https://api.github.com/users/wilson0xb4/repos","events_url":"https://api.github.com/users/wilson0xb4/events{/privacy}","received_events_url":"https://api.github.com/users/wilson0xb4/received_events","type":"User","site_admin":false},"repo":{"id":38008290,"name":"data-structures","full_name":"wilson0xb4/data-structures","owner":{"login":"wilson0xb4","id":1644683,"avatar_url":"https://avatars.githubusercontent.com/u/1644683?v=3","gravatar_id":"","url":"https://api.github.com/users/wilson0xb4","html_url":"https://github.com/wilson0xb4","followers_url":"https://api.github.com/users/wilson0xb4/followers","following_url":"https://api.github.com/users/wilson0xb4/following{/other_user}","gists_url":"https://api.github.com/users/wilson0xb4/gists{/gist_id}","starred_url":"https://api.github.com/users/wilson0xb4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilson0xb4/subscriptions","organizations_url":"https://api.github.com/users/wilson0xb4/orgs","repos_url":"https://api.github.com/users/wilson0xb4/repos","events_url":"https://api.github.com/users/wilson0xb4/events{/privacy}","received_events_url":"https://api.github.com/users/wilson0xb4/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wilson0xb4/data-structures","description":"Sample code for a number of classic data structures implemented in Python","fork":false,"url":"https://api.github.com/repos/wilson0xb4/data-structures","forks_url":"https://api.github.com/repos/wilson0xb4/data-structures/forks","keys_url":"https://api.github.com/repos/wilson0xb4/data-structures/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wilson0xb4/data-structures/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wilson0xb4/data-structures/teams","hooks_url":"https://api.github.com/repos/wilson0xb4/data-structures/hooks","issue_events_url":"https://api.github.com/repos/wilson0xb4/data-structures/issues/events{/number}","events_url":"https://api.github.com/repos/wilson0xb4/data-structures/events","assignees_url":"https://api.github.com/repos/wilson0xb4/data-structures/assignees{/user}","branches_url":"https://api.github.com/repos/wilson0xb4/data-structures/branches{/branch}","tags_url":"https://api.github.com/repos/wilson0xb4/data-structures/tags","blobs_url":"https://api.github.com/repos/wilson0xb4/data-structures/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wilson0xb4/data-structures/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wilson0xb4/data-structures/git/refs{/sha}","trees_url":"https://api.github.com/repos/wilson0xb4/data-structures/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wilson0xb4/data-structures/statuses/{sha}","languages_url":"https://api.github.com/repos/wilson0xb4/data-structures/languages","stargazers_url":"https://api.github.com/repos/wilson0xb4/data-structures/stargazers","contributors_url":"https://api.github.com/repos/wilson0xb4/data-structures/contributors","subscribers_url":"https://api.github.com/repos/wilson0xb4/data-structures/subscribers","subscription_url":"https://api.github.com/repos/wilson0xb4/data-structures/subscription","commits_url":"https://api.github.com/repos/wilson0xb4/data-structures/commits{/sha}","git_commits_url":"https://api.github.com/repos/wilson0xb4/data-structures/git/commits{/sha}","comments_url":"https://api.github.com/repos/wilson0xb4/data-structures/comments{/number}","issue_comment_url":"https://api.github.com/repos/wilson0xb4/data-structures/issues/comments{/number}","contents_url":"https://api.github.com/repos/wilson0xb4/data-structures/contents/{+path}","compare_url":"https://api.github.com/repos/wilson0xb4/data-structures/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wilson0xb4/data-structures/merges","archive_url":"https://api.github.com/repos/wilson0xb4/data-structures/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wilson0xb4/data-structures/downloads","issues_url":"https://api.github.com/repos/wilson0xb4/data-structures/issues{/number}","pulls_url":"https://api.github.com/repos/wilson0xb4/data-structures/pulls{/number}","milestones_url":"https://api.github.com/repos/wilson0xb4/data-structures/milestones{/number}","notifications_url":"https://api.github.com/repos/wilson0xb4/data-structures/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wilson0xb4/data-structures/labels{/name}","releases_url":"https://api.github.com/repos/wilson0xb4/data-structures/releases{/id}","created_at":"2015-06-24T20:08:35Z","updated_at":"2015-06-24T22:53:37Z","pushed_at":"2015-07-09T21:48:18Z","git_url":"git://github.com/wilson0xb4/data-structures.git","ssh_url":"git@github.com:wilson0xb4/data-structures.git","clone_url":"https://github.com/wilson0xb4/data-structures.git","svn_url":"https://github.com/wilson0xb4/data-structures","homepage":null,"size":316,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"wilson0xb4:master","ref":"master","sha":"1d4f02bfd5c5da536db13ecc154b6d275290a8fb","user":{"login":"wilson0xb4","id":1644683,"avatar_url":"https://avatars.githubusercontent.com/u/1644683?v=3","gravatar_id":"","url":"https://api.github.com/users/wilson0xb4","html_url":"https://github.com/wilson0xb4","followers_url":"https://api.github.com/users/wilson0xb4/followers","following_url":"https://api.github.com/users/wilson0xb4/following{/other_user}","gists_url":"https://api.github.com/users/wilson0xb4/gists{/gist_id}","starred_url":"https://api.github.com/users/wilson0xb4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilson0xb4/subscriptions","organizations_url":"https://api.github.com/users/wilson0xb4/orgs","repos_url":"https://api.github.com/users/wilson0xb4/repos","events_url":"https://api.github.com/users/wilson0xb4/events{/privacy}","received_events_url":"https://api.github.com/users/wilson0xb4/received_events","type":"User","site_admin":false},"repo":{"id":38008290,"name":"data-structures","full_name":"wilson0xb4/data-structures","owner":{"login":"wilson0xb4","id":1644683,"avatar_url":"https://avatars.githubusercontent.com/u/1644683?v=3","gravatar_id":"","url":"https://api.github.com/users/wilson0xb4","html_url":"https://github.com/wilson0xb4","followers_url":"https://api.github.com/users/wilson0xb4/followers","following_url":"https://api.github.com/users/wilson0xb4/following{/other_user}","gists_url":"https://api.github.com/users/wilson0xb4/gists{/gist_id}","starred_url":"https://api.github.com/users/wilson0xb4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilson0xb4/subscriptions","organizations_url":"https://api.github.com/users/wilson0xb4/orgs","repos_url":"https://api.github.com/users/wilson0xb4/repos","events_url":"https://api.github.com/users/wilson0xb4/events{/privacy}","received_events_url":"https://api.github.com/users/wilson0xb4/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wilson0xb4/data-structures","description":"Sample code for a number of classic data structures implemented in Python","fork":false,"url":"https://api.github.com/repos/wilson0xb4/data-structures","forks_url":"https://api.github.com/repos/wilson0xb4/data-structures/forks","keys_url":"https://api.github.com/repos/wilson0xb4/data-structures/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wilson0xb4/data-structures/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wilson0xb4/data-structures/teams","hooks_url":"https://api.github.com/repos/wilson0xb4/data-structures/hooks","issue_events_url":"https://api.github.com/repos/wilson0xb4/data-structures/issues/events{/number}","events_url":"https://api.github.com/repos/wilson0xb4/data-structures/events","assignees_url":"https://api.github.com/repos/wilson0xb4/data-structures/assignees{/user}","branches_url":"https://api.github.com/repos/wilson0xb4/data-structures/branches{/branch}","tags_url":"https://api.github.com/repos/wilson0xb4/data-structures/tags","blobs_url":"https://api.github.com/repos/wilson0xb4/data-structures/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wilson0xb4/data-structures/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wilson0xb4/data-structures/git/refs{/sha}","trees_url":"https://api.github.com/repos/wilson0xb4/data-structures/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wilson0xb4/data-structures/statuses/{sha}","languages_url":"https://api.github.com/repos/wilson0xb4/data-structures/languages","stargazers_url":"https://api.github.com/repos/wilson0xb4/data-structures/stargazers","contributors_url":"https://api.github.com/repos/wilson0xb4/data-structures/contributors","subscribers_url":"https://api.github.com/repos/wilson0xb4/data-structures/subscribers","subscription_url":"https://api.github.com/repos/wilson0xb4/data-structures/subscription","commits_url":"https://api.github.com/repos/wilson0xb4/data-structures/commits{/sha}","git_commits_url":"https://api.github.com/repos/wilson0xb4/data-structures/git/commits{/sha}","comments_url":"https://api.github.com/repos/wilson0xb4/data-structures/comments{/number}","issue_comment_url":"https://api.github.com/repos/wilson0xb4/data-structures/issues/comments{/number}","contents_url":"https://api.github.com/repos/wilson0xb4/data-structures/contents/{+path}","compare_url":"https://api.github.com/repos/wilson0xb4/data-structures/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wilson0xb4/data-structures/merges","archive_url":"https://api.github.com/repos/wilson0xb4/data-structures/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wilson0xb4/data-structures/downloads","issues_url":"https://api.github.com/repos/wilson0xb4/data-structures/issues{/number}","pulls_url":"https://api.github.com/repos/wilson0xb4/data-structures/pulls{/number}","milestones_url":"https://api.github.com/repos/wilson0xb4/data-structures/milestones{/number}","notifications_url":"https://api.github.com/repos/wilson0xb4/data-structures/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wilson0xb4/data-structures/labels{/name}","releases_url":"https://api.github.com/repos/wilson0xb4/data-structures/releases{/id}","created_at":"2015-06-24T20:08:35Z","updated_at":"2015-06-24T22:53:37Z","pushed_at":"2015-07-09T21:48:18Z","git_url":"git://github.com/wilson0xb4/data-structures.git","ssh_url":"git@github.com:wilson0xb4/data-structures.git","clone_url":"https://github.com/wilson0xb4/data-structures.git","svn_url":"https://github.com/wilson0xb4/data-structures","homepage":null,"size":316,"stargazers_count":0,"watchers_count":0,"language":"Python","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/wilson0xb4/data-structures/pulls/14"},"html":{"href":"https://github.com/wilson0xb4/data-structures/pull/14"},"issue":{"href":"https://api.github.com/repos/wilson0xb4/data-structures/issues/14"},"comments":{"href":"https://api.github.com/repos/wilson0xb4/data-structures/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/wilson0xb4/data-structures/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/wilson0xb4/data-structures/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wilson0xb4/data-structures/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/wilson0xb4/data-structures/statuses/ddf543d1ced1f31c06f777ae5bd9a088493f355e"}}}}