{"action":"created","comment":{"url":"https://api.github.com/repos/Bradfield/algos/pulls/comments/47875531","id":47875531,"diff_hunk":"@@ -5,68 +5,53 @@ position: 1\n layout: chapter.html\n ---\n \n-Every software engineer will have a different answer to the question\n-“what makes one computer program better than another?” Some may focus\n-on the readability of the code, others on the engineering paradigms\n-used, others on “efficiency”, and so on.\n-\n-When we put aside the language- or implementation-specific aspects of a\n-program and talk about the underlying _algorithm_, there are fewer\n-comparisons to be made. We concern ourselves here with comparing\n-algorithms based upon the amount of computing resources used, in other\n-words we want to be able to compare two algorithms and say that one is\n-better than the other because it is more economical in its use of\n-computing resources.\n-\n-Typically, the two “computing resources” that we care about are space\n-(such as memory) and time. In different contexts, we may be willing to\n-compromise one more than another, for instance we may be willing for\n-a program to run longer so long as it doesn’t exceed a certain amount\n-of allocated space, or conversely we may be willing to use more memory\n-in order to reduce the running time of a program. As such we want a\n-vocabulary and method of analysis that allows us to discuss the usage\n-of space and time for any algorithm we encounter.\n+What makes one computer program better than another?\n \n-One way we _could_ measure the running time for a program is to do a\n-benchmark analysis. This would involve tracking the actual time required\n-for the program to compute its result.\n+The answer depends on the criteria we use: code readability, engineering\n+paradigms, and efficiency are a few possible metrics by which we we could\n+measure a program's quality.\n \n-In Python, we can benchmark a function by noting the starting time and\n-ending time with respect to the system we are using. In the `time`\n-module there is a function called `time` that will return the current\n-system clock time in seconds since some arbitrary starting point. By\n-calling this function twice, at the beginning and at the end, and then\n-computing the difference, we can get an exact number of seconds\n-(fractions in most cases) for execution.\n+Let's set aside aspects of a program that are specific to language or\n+implementation and instead focus on the underlying _algorithm_. Doing this\n+limits the number of factors we have to consider and enables us to make bold\n+statements like \"Tesla's algorithm is better than Edison's algorithm because","path":"book/analysis/introduction.md","position":44,"original_position":44,"commit_id":"f45ca7bef51d5589112e65f130928da97e7ec6fe","original_commit_id":"f45ca7bef51d5589112e65f130928da97e7ec6fe","user":{"login":"aleksharma12","id":5043885,"avatar_url":"https://avatars.githubusercontent.com/u/5043885?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksharma12","html_url":"https://github.com/aleksharma12","followers_url":"https://api.github.com/users/aleksharma12/followers","following_url":"https://api.github.com/users/aleksharma12/following{/other_user}","gists_url":"https://api.github.com/users/aleksharma12/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksharma12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksharma12/subscriptions","organizations_url":"https://api.github.com/users/aleksharma12/orgs","repos_url":"https://api.github.com/users/aleksharma12/repos","events_url":"https://api.github.com/users/aleksharma12/events{/privacy}","received_events_url":"https://api.github.com/users/aleksharma12/received_events","type":"User","site_admin":false},"body":"https://www.youtube.com/watch?v=Mm3ypbAbLJ8&t=0m12s","created_at":"2015-12-17T07:11:49Z","updated_at":"2015-12-17T07:11:49Z","html_url":"https://github.com/Bradfield/algos/pull/9#discussion_r47875531","pull_request_url":"https://api.github.com/repos/Bradfield/algos/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/Bradfield/algos/pulls/comments/47875531"},"html":{"href":"https://github.com/Bradfield/algos/pull/9#discussion_r47875531"},"pull_request":{"href":"https://api.github.com/repos/Bradfield/algos/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/Bradfield/algos/pulls/9","id":53937528,"html_url":"https://github.com/Bradfield/algos/pull/9","diff_url":"https://github.com/Bradfield/algos/pull/9.diff","patch_url":"https://github.com/Bradfield/algos/pull/9.patch","issue_url":"https://api.github.com/repos/Bradfield/algos/issues/9","number":9,"state":"open","locked":false,"title":"Edits for Analysis: Introduction","user":{"login":"aleksharma12","id":5043885,"avatar_url":"https://avatars.githubusercontent.com/u/5043885?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksharma12","html_url":"https://github.com/aleksharma12","followers_url":"https://api.github.com/users/aleksharma12/followers","following_url":"https://api.github.com/users/aleksharma12/following{/other_user}","gists_url":"https://api.github.com/users/aleksharma12/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksharma12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksharma12/subscriptions","organizations_url":"https://api.github.com/users/aleksharma12/orgs","repos_url":"https://api.github.com/users/aleksharma12/repos","events_url":"https://api.github.com/users/aleksharma12/events{/privacy}","received_events_url":"https://api.github.com/users/aleksharma12/received_events","type":"User","site_admin":false},"body":"* professional comma addition/removal\r\n* overzealous semicolon placement\r\n* complete rewrites of some sections\r\n* insertion of more self-aware author voice","created_at":"2015-12-17T05:54:20Z","updated_at":"2015-12-17T07:11:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c812f9ea224580ea1b2e3062342757f14dd475be","assignee":{"login":"ozan","id":113359,"avatar_url":"https://avatars.githubusercontent.com/u/113359?v=3","gravatar_id":"","url":"https://api.github.com/users/ozan","html_url":"https://github.com/ozan","followers_url":"https://api.github.com/users/ozan/followers","following_url":"https://api.github.com/users/ozan/following{/other_user}","gists_url":"https://api.github.com/users/ozan/gists{/gist_id}","starred_url":"https://api.github.com/users/ozan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ozan/subscriptions","organizations_url":"https://api.github.com/users/ozan/orgs","repos_url":"https://api.github.com/users/ozan/repos","events_url":"https://api.github.com/users/ozan/events{/privacy}","received_events_url":"https://api.github.com/users/ozan/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Bradfield/algos/pulls/9/commits","review_comments_url":"https://api.github.com/repos/Bradfield/algos/pulls/9/comments","review_comment_url":"https://api.github.com/repos/Bradfield/algos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Bradfield/algos/issues/9/comments","statuses_url":"https://api.github.com/repos/Bradfield/algos/statuses/f45ca7bef51d5589112e65f130928da97e7ec6fe","head":{"label":"Bradfield:edits_analysis_introduction","ref":"edits_analysis_introduction","sha":"f45ca7bef51d5589112e65f130928da97e7ec6fe","user":{"login":"Bradfield","id":13907497,"avatar_url":"https://avatars.githubusercontent.com/u/13907497?v=3","gravatar_id":"","url":"https://api.github.com/users/Bradfield","html_url":"https://github.com/Bradfield","followers_url":"https://api.github.com/users/Bradfield/followers","following_url":"https://api.github.com/users/Bradfield/following{/other_user}","gists_url":"https://api.github.com/users/Bradfield/gists{/gist_id}","starred_url":"https://api.github.com/users/Bradfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bradfield/subscriptions","organizations_url":"https://api.github.com/users/Bradfield/orgs","repos_url":"https://api.github.com/users/Bradfield/repos","events_url":"https://api.github.com/users/Bradfield/events{/privacy}","received_events_url":"https://api.github.com/users/Bradfield/received_events","type":"Organization","site_admin":false},"repo":{"id":42077328,"name":"algos","full_name":"Bradfield/algos","owner":{"login":"Bradfield","id":13907497,"avatar_url":"https://avatars.githubusercontent.com/u/13907497?v=3","gravatar_id":"","url":"https://api.github.com/users/Bradfield","html_url":"https://github.com/Bradfield","followers_url":"https://api.github.com/users/Bradfield/followers","following_url":"https://api.github.com/users/Bradfield/following{/other_user}","gists_url":"https://api.github.com/users/Bradfield/gists{/gist_id}","starred_url":"https://api.github.com/users/Bradfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bradfield/subscriptions","organizations_url":"https://api.github.com/users/Bradfield/orgs","repos_url":"https://api.github.com/users/Bradfield/repos","events_url":"https://api.github.com/users/Bradfield/events{/privacy}","received_events_url":"https://api.github.com/users/Bradfield/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Bradfield/algos","description":"Algorithms and Data Structures book","fork":false,"url":"https://api.github.com/repos/Bradfield/algos","forks_url":"https://api.github.com/repos/Bradfield/algos/forks","keys_url":"https://api.github.com/repos/Bradfield/algos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bradfield/algos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bradfield/algos/teams","hooks_url":"https://api.github.com/repos/Bradfield/algos/hooks","issue_events_url":"https://api.github.com/repos/Bradfield/algos/issues/events{/number}","events_url":"https://api.github.com/repos/Bradfield/algos/events","assignees_url":"https://api.github.com/repos/Bradfield/algos/assignees{/user}","branches_url":"https://api.github.com/repos/Bradfield/algos/branches{/branch}","tags_url":"https://api.github.com/repos/Bradfield/algos/tags","blobs_url":"https://api.github.com/repos/Bradfield/algos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bradfield/algos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bradfield/algos/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bradfield/algos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bradfield/algos/statuses/{sha}","languages_url":"https://api.github.com/repos/Bradfield/algos/languages","stargazers_url":"https://api.github.com/repos/Bradfield/algos/stargazers","contributors_url":"https://api.github.com/repos/Bradfield/algos/contributors","subscribers_url":"https://api.github.com/repos/Bradfield/algos/subscribers","subscription_url":"https://api.github.com/repos/Bradfield/algos/subscription","commits_url":"https://api.github.com/repos/Bradfield/algos/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bradfield/algos/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bradfield/algos/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bradfield/algos/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bradfield/algos/contents/{+path}","compare_url":"https://api.github.com/repos/Bradfield/algos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bradfield/algos/merges","archive_url":"https://api.github.com/repos/Bradfield/algos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bradfield/algos/downloads","issues_url":"https://api.github.com/repos/Bradfield/algos/issues{/number}","pulls_url":"https://api.github.com/repos/Bradfield/algos/pulls{/number}","milestones_url":"https://api.github.com/repos/Bradfield/algos/milestones{/number}","notifications_url":"https://api.github.com/repos/Bradfield/algos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bradfield/algos/labels{/name}","releases_url":"https://api.github.com/repos/Bradfield/algos/releases{/id}","created_at":"2015-09-07T22:27:15Z","updated_at":"2015-11-17T02:28:08Z","pushed_at":"2015-12-17T05:54:20Z","git_url":"git://github.com/Bradfield/algos.git","ssh_url":"git@github.com:Bradfield/algos.git","clone_url":"https://github.com/Bradfield/algos.git","svn_url":"https://github.com/Bradfield/algos","homepage":"http://bradfield.institute/algos","size":10971,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Bradfield:master","ref":"master","sha":"4b33f67baeaa27bec484b9f61fe0d08b356ac86c","user":{"login":"Bradfield","id":13907497,"avatar_url":"https://avatars.githubusercontent.com/u/13907497?v=3","gravatar_id":"","url":"https://api.github.com/users/Bradfield","html_url":"https://github.com/Bradfield","followers_url":"https://api.github.com/users/Bradfield/followers","following_url":"https://api.github.com/users/Bradfield/following{/other_user}","gists_url":"https://api.github.com/users/Bradfield/gists{/gist_id}","starred_url":"https://api.github.com/users/Bradfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bradfield/subscriptions","organizations_url":"https://api.github.com/users/Bradfield/orgs","repos_url":"https://api.github.com/users/Bradfield/repos","events_url":"https://api.github.com/users/Bradfield/events{/privacy}","received_events_url":"https://api.github.com/users/Bradfield/received_events","type":"Organization","site_admin":false},"repo":{"id":42077328,"name":"algos","full_name":"Bradfield/algos","owner":{"login":"Bradfield","id":13907497,"avatar_url":"https://avatars.githubusercontent.com/u/13907497?v=3","gravatar_id":"","url":"https://api.github.com/users/Bradfield","html_url":"https://github.com/Bradfield","followers_url":"https://api.github.com/users/Bradfield/followers","following_url":"https://api.github.com/users/Bradfield/following{/other_user}","gists_url":"https://api.github.com/users/Bradfield/gists{/gist_id}","starred_url":"https://api.github.com/users/Bradfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bradfield/subscriptions","organizations_url":"https://api.github.com/users/Bradfield/orgs","repos_url":"https://api.github.com/users/Bradfield/repos","events_url":"https://api.github.com/users/Bradfield/events{/privacy}","received_events_url":"https://api.github.com/users/Bradfield/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Bradfield/algos","description":"Algorithms and Data Structures book","fork":false,"url":"https://api.github.com/repos/Bradfield/algos","forks_url":"https://api.github.com/repos/Bradfield/algos/forks","keys_url":"https://api.github.com/repos/Bradfield/algos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bradfield/algos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bradfield/algos/teams","hooks_url":"https://api.github.com/repos/Bradfield/algos/hooks","issue_events_url":"https://api.github.com/repos/Bradfield/algos/issues/events{/number}","events_url":"https://api.github.com/repos/Bradfield/algos/events","assignees_url":"https://api.github.com/repos/Bradfield/algos/assignees{/user}","branches_url":"https://api.github.com/repos/Bradfield/algos/branches{/branch}","tags_url":"https://api.github.com/repos/Bradfield/algos/tags","blobs_url":"https://api.github.com/repos/Bradfield/algos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bradfield/algos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bradfield/algos/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bradfield/algos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bradfield/algos/statuses/{sha}","languages_url":"https://api.github.com/repos/Bradfield/algos/languages","stargazers_url":"https://api.github.com/repos/Bradfield/algos/stargazers","contributors_url":"https://api.github.com/repos/Bradfield/algos/contributors","subscribers_url":"https://api.github.com/repos/Bradfield/algos/subscribers","subscription_url":"https://api.github.com/repos/Bradfield/algos/subscription","commits_url":"https://api.github.com/repos/Bradfield/algos/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bradfield/algos/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bradfield/algos/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bradfield/algos/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bradfield/algos/contents/{+path}","compare_url":"https://api.github.com/repos/Bradfield/algos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bradfield/algos/merges","archive_url":"https://api.github.com/repos/Bradfield/algos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bradfield/algos/downloads","issues_url":"https://api.github.com/repos/Bradfield/algos/issues{/number}","pulls_url":"https://api.github.com/repos/Bradfield/algos/pulls{/number}","milestones_url":"https://api.github.com/repos/Bradfield/algos/milestones{/number}","notifications_url":"https://api.github.com/repos/Bradfield/algos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bradfield/algos/labels{/name}","releases_url":"https://api.github.com/repos/Bradfield/algos/releases{/id}","created_at":"2015-09-07T22:27:15Z","updated_at":"2015-11-17T02:28:08Z","pushed_at":"2015-12-17T05:54:20Z","git_url":"git://github.com/Bradfield/algos.git","ssh_url":"git@github.com:Bradfield/algos.git","clone_url":"https://github.com/Bradfield/algos.git","svn_url":"https://github.com/Bradfield/algos","homepage":"http://bradfield.institute/algos","size":10971,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Bradfield/algos/pulls/9"},"html":{"href":"https://github.com/Bradfield/algos/pull/9"},"issue":{"href":"https://api.github.com/repos/Bradfield/algos/issues/9"},"comments":{"href":"https://api.github.com/repos/Bradfield/algos/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/Bradfield/algos/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/Bradfield/algos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Bradfield/algos/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/Bradfield/algos/statuses/f45ca7bef51d5589112e65f130928da97e7ec6fe"}}}}