{"action":"closed","number":5,"pull_request":{"url":"https://api.github.com/repos/pravj648/container/pulls/5","id":49036616,"html_url":"https://github.com/pravj648/container/pull/5","diff_url":"https://github.com/pravj648/container/pull/5.diff","patch_url":"https://github.com/pravj648/container/pull/5.patch","issue_url":"https://api.github.com/repos/pravj648/container/issues/5","number":5,"state":"closed","locked":false,"title":"Count no. of inversions in an array","user":{"login":"imshyam","id":3381173,"avatar_url":"https://avatars.githubusercontent.com/u/3381173?v=3","gravatar_id":"","url":"https://api.github.com/users/imshyam","html_url":"https://github.com/imshyam","followers_url":"https://api.github.com/users/imshyam/followers","following_url":"https://api.github.com/users/imshyam/following{/other_user}","gists_url":"https://api.github.com/users/imshyam/gists{/gist_id}","starred_url":"https://api.github.com/users/imshyam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imshyam/subscriptions","organizations_url":"https://api.github.com/users/imshyam/orgs","repos_url":"https://api.github.com/users/imshyam/repos","events_url":"https://api.github.com/users/imshyam/events{/privacy}","received_events_url":"https://api.github.com/users/imshyam/received_events","type":"User","site_admin":false},"body":"How to get number of inversions in merge()?\r\n        In merge process, let j is used for indexing left sub-array and k for right sub-array.\r\n        At any step in merge(), if a[j] is greater than a[k], then there are (mid – j) inversions.\r\n        because left and right subarrays are sorted, so all the remaining elements in left-subarray (a[j+1], a[j+2] … a[mid]) will be greater than a[k].\r\n        for example : in 3 1 2, there are 2 inversions.\r\n          so in merging 1 and 2 no inversions will be made.\r\n          and in merging 3 and 1, 2 there will be two inversions.\r\n          1 will be during merge of 3 and 1 and other one will during 3 and 2.","created_at":"2015-10-28T17:07:14Z","updated_at":"2015-10-28T17:21:57Z","closed_at":"2015-10-28T17:21:57Z","merged_at":"2015-10-28T17:21:57Z","merge_commit_sha":"48897333be203884f6ea4b6017a9461581ec08b3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pravj648/container/pulls/5/commits","review_comments_url":"https://api.github.com/repos/pravj648/container/pulls/5/comments","review_comment_url":"https://api.github.com/repos/pravj648/container/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pravj648/container/issues/5/comments","statuses_url":"https://api.github.com/repos/pravj648/container/statuses/912e830b728e911a3b3b1e7957416cfaa4090513","head":{"label":"pravj648:imshyam","ref":"imshyam","sha":"912e830b728e911a3b3b1e7957416cfaa4090513","user":{"login":"pravj648","id":7828753,"avatar_url":"https://avatars.githubusercontent.com/u/7828753?v=3","gravatar_id":"","url":"https://api.github.com/users/pravj648","html_url":"https://github.com/pravj648","followers_url":"https://api.github.com/users/pravj648/followers","following_url":"https://api.github.com/users/pravj648/following{/other_user}","gists_url":"https://api.github.com/users/pravj648/gists{/gist_id}","starred_url":"https://api.github.com/users/pravj648/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pravj648/subscriptions","organizations_url":"https://api.github.com/users/pravj648/orgs","repos_url":"https://api.github.com/users/pravj648/repos","events_url":"https://api.github.com/users/pravj648/events{/privacy}","received_events_url":"https://api.github.com/users/pravj648/received_events","type":"User","site_admin":false},"repo":{"id":45098211,"name":"container","full_name":"pravj648/container","owner":{"login":"pravj648","id":7828753,"avatar_url":"https://avatars.githubusercontent.com/u/7828753?v=3","gravatar_id":"","url":"https://api.github.com/users/pravj648","html_url":"https://github.com/pravj648","followers_url":"https://api.github.com/users/pravj648/followers","following_url":"https://api.github.com/users/pravj648/following{/other_user}","gists_url":"https://api.github.com/users/pravj648/gists{/gist_id}","starred_url":"https://api.github.com/users/pravj648/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pravj648/subscriptions","organizations_url":"https://api.github.com/users/pravj648/orgs","repos_url":"https://api.github.com/users/pravj648/repos","events_url":"https://api.github.com/users/pravj648/events{/privacy}","received_events_url":"https://api.github.com/users/pravj648/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pravj648/container","description":"Algorithms, the Universe and Everything","fork":false,"url":"https://api.github.com/repos/pravj648/container","forks_url":"https://api.github.com/repos/pravj648/container/forks","keys_url":"https://api.github.com/repos/pravj648/container/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pravj648/container/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pravj648/container/teams","hooks_url":"https://api.github.com/repos/pravj648/container/hooks","issue_events_url":"https://api.github.com/repos/pravj648/container/issues/events{/number}","events_url":"https://api.github.com/repos/pravj648/container/events","assignees_url":"https://api.github.com/repos/pravj648/container/assignees{/user}","branches_url":"https://api.github.com/repos/pravj648/container/branches{/branch}","tags_url":"https://api.github.com/repos/pravj648/container/tags","blobs_url":"https://api.github.com/repos/pravj648/container/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pravj648/container/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pravj648/container/git/refs{/sha}","trees_url":"https://api.github.com/repos/pravj648/container/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pravj648/container/statuses/{sha}","languages_url":"https://api.github.com/repos/pravj648/container/languages","stargazers_url":"https://api.github.com/repos/pravj648/container/stargazers","contributors_url":"https://api.github.com/repos/pravj648/container/contributors","subscribers_url":"https://api.github.com/repos/pravj648/container/subscribers","subscription_url":"https://api.github.com/repos/pravj648/container/subscription","commits_url":"https://api.github.com/repos/pravj648/container/commits{/sha}","git_commits_url":"https://api.github.com/repos/pravj648/container/git/commits{/sha}","comments_url":"https://api.github.com/repos/pravj648/container/comments{/number}","issue_comment_url":"https://api.github.com/repos/pravj648/container/issues/comments{/number}","contents_url":"https://api.github.com/repos/pravj648/container/contents/{+path}","compare_url":"https://api.github.com/repos/pravj648/container/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pravj648/container/merges","archive_url":"https://api.github.com/repos/pravj648/container/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pravj648/container/downloads","issues_url":"https://api.github.com/repos/pravj648/container/issues{/number}","pulls_url":"https://api.github.com/repos/pravj648/container/pulls{/number}","milestones_url":"https://api.github.com/repos/pravj648/container/milestones{/number}","notifications_url":"https://api.github.com/repos/pravj648/container/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pravj648/container/labels{/name}","releases_url":"https://api.github.com/repos/pravj648/container/releases{/id}","created_at":"2015-10-28T08:18:43Z","updated_at":"2015-10-28T11:45:47Z","pushed_at":"2015-10-28T17:21:57Z","git_url":"git://github.com/pravj648/container.git","ssh_url":"git@github.com:pravj648/container.git","clone_url":"https://github.com/pravj648/container.git","svn_url":"https://github.com/pravj648/container","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pravj648:master","ref":"master","sha":"20799c13305eeec50a28df449f2fb649c98ff000","user":{"login":"pravj648","id":7828753,"avatar_url":"https://avatars.githubusercontent.com/u/7828753?v=3","gravatar_id":"","url":"https://api.github.com/users/pravj648","html_url":"https://github.com/pravj648","followers_url":"https://api.github.com/users/pravj648/followers","following_url":"https://api.github.com/users/pravj648/following{/other_user}","gists_url":"https://api.github.com/users/pravj648/gists{/gist_id}","starred_url":"https://api.github.com/users/pravj648/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pravj648/subscriptions","organizations_url":"https://api.github.com/users/pravj648/orgs","repos_url":"https://api.github.com/users/pravj648/repos","events_url":"https://api.github.com/users/pravj648/events{/privacy}","received_events_url":"https://api.github.com/users/pravj648/received_events","type":"User","site_admin":false},"repo":{"id":45098211,"name":"container","full_name":"pravj648/container","owner":{"login":"pravj648","id":7828753,"avatar_url":"https://avatars.githubusercontent.com/u/7828753?v=3","gravatar_id":"","url":"https://api.github.com/users/pravj648","html_url":"https://github.com/pravj648","followers_url":"https://api.github.com/users/pravj648/followers","following_url":"https://api.github.com/users/pravj648/following{/other_user}","gists_url":"https://api.github.com/users/pravj648/gists{/gist_id}","starred_url":"https://api.github.com/users/pravj648/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pravj648/subscriptions","organizations_url":"https://api.github.com/users/pravj648/orgs","repos_url":"https://api.github.com/users/pravj648/repos","events_url":"https://api.github.com/users/pravj648/events{/privacy}","received_events_url":"https://api.github.com/users/pravj648/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pravj648/container","description":"Algorithms, the Universe and Everything","fork":false,"url":"https://api.github.com/repos/pravj648/container","forks_url":"https://api.github.com/repos/pravj648/container/forks","keys_url":"https://api.github.com/repos/pravj648/container/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pravj648/container/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pravj648/container/teams","hooks_url":"https://api.github.com/repos/pravj648/container/hooks","issue_events_url":"https://api.github.com/repos/pravj648/container/issues/events{/number}","events_url":"https://api.github.com/repos/pravj648/container/events","assignees_url":"https://api.github.com/repos/pravj648/container/assignees{/user}","branches_url":"https://api.github.com/repos/pravj648/container/branches{/branch}","tags_url":"https://api.github.com/repos/pravj648/container/tags","blobs_url":"https://api.github.com/repos/pravj648/container/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pravj648/container/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pravj648/container/git/refs{/sha}","trees_url":"https://api.github.com/repos/pravj648/container/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pravj648/container/statuses/{sha}","languages_url":"https://api.github.com/repos/pravj648/container/languages","stargazers_url":"https://api.github.com/repos/pravj648/container/stargazers","contributors_url":"https://api.github.com/repos/pravj648/container/contributors","subscribers_url":"https://api.github.com/repos/pravj648/container/subscribers","subscription_url":"https://api.github.com/repos/pravj648/container/subscription","commits_url":"https://api.github.com/repos/pravj648/container/commits{/sha}","git_commits_url":"https://api.github.com/repos/pravj648/container/git/commits{/sha}","comments_url":"https://api.github.com/repos/pravj648/container/comments{/number}","issue_comment_url":"https://api.github.com/repos/pravj648/container/issues/comments{/number}","contents_url":"https://api.github.com/repos/pravj648/container/contents/{+path}","compare_url":"https://api.github.com/repos/pravj648/container/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pravj648/container/merges","archive_url":"https://api.github.com/repos/pravj648/container/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pravj648/container/downloads","issues_url":"https://api.github.com/repos/pravj648/container/issues{/number}","pulls_url":"https://api.github.com/repos/pravj648/container/pulls{/number}","milestones_url":"https://api.github.com/repos/pravj648/container/milestones{/number}","notifications_url":"https://api.github.com/repos/pravj648/container/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pravj648/container/labels{/name}","releases_url":"https://api.github.com/repos/pravj648/container/releases{/id}","created_at":"2015-10-28T08:18:43Z","updated_at":"2015-10-28T11:45:47Z","pushed_at":"2015-10-28T17:21:57Z","git_url":"git://github.com/pravj648/container.git","ssh_url":"git@github.com:pravj648/container.git","clone_url":"https://github.com/pravj648/container.git","svn_url":"https://github.com/pravj648/container","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pravj648/container/pulls/5"},"html":{"href":"https://github.com/pravj648/container/pull/5"},"issue":{"href":"https://api.github.com/repos/pravj648/container/issues/5"},"comments":{"href":"https://api.github.com/repos/pravj648/container/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/pravj648/container/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/pravj648/container/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pravj648/container/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/pravj648/container/statuses/912e830b728e911a3b3b1e7957416cfaa4090513"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"pravj","id":3437250,"avatar_url":"https://avatars.githubusercontent.com/u/3437250?v=3","gravatar_id":"","url":"https://api.github.com/users/pravj","html_url":"https://github.com/pravj","followers_url":"https://api.github.com/users/pravj/followers","following_url":"https://api.github.com/users/pravj/following{/other_user}","gists_url":"https://api.github.com/users/pravj/gists{/gist_id}","starred_url":"https://api.github.com/users/pravj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pravj/subscriptions","organizations_url":"https://api.github.com/users/pravj/orgs","repos_url":"https://api.github.com/users/pravj/repos","events_url":"https://api.github.com/users/pravj/events{/privacy}","received_events_url":"https://api.github.com/users/pravj/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":1,"additions":69,"deletions":0,"changed_files":1}}