{"action":"created","comment":{"url":"https://api.github.com/repos/iiitv/algos/pulls/comments/122419318","pull_request_review_id":44534201,"id":122419318,"diff_hunk":"@@ -0,0 +1,61 @@\n+def partition(a, start, end):\n+    \"\"\"\n+    Perform Partition Operation on array a.\n+    Time Complexity: o(nLogn)\n+    Auxiliary Space: O(n)\n+    :param a: Iterable of elements\n+    :param start: pivot value for array\n+    :param end: right limit of array\n+    :return: return i value for function, used in partitioning of array.\n+    \"\"\"\n+    i = start - 1\n+    pivot = a[end]\n+    for j in range(start, end):\n+        if a[j] <= pivot:\n+            i += 1\n+            a[i], a[j] = a[j], a[i]\n+    i += 1\n+    a[i], a[end] = a[end], a[i]\n+    return i\n+\n+\n+def quick_select(a, k):\n+    \"\"\"\n+    Perform quick select operation i.e find kth minimum element from array\n+    Time Complexity: O(n) for average case and O(n^2) for worst cases\n+    param a: Array on which operation would perfom\n+    param k: kth minimun element have to find\n+    return: returns kth minimum value\n+    \"\"\"\n+    if a is None:\n+        print (\"Array doesn't exist\")\n+        return None\n+    elif len(a) <= k:\n+        print (\"k is greater than\", len(a) - 1)\n+        return None\n+    else:\n+        start = 0\n+        end = len(a)-1\n+        is_found = False\n+        while not is_found :\n+            pos = partition(a, start, end)\n+            if pos == k:\n+                is_found = True\n+                return a[pos]\n+            elif pos < k:\n+                start = pos + 1\n+            else:\n+                end = pos - 1\n+    return None\n+\n+\n+def main():\n+    a = [2, 4, 6, 2, 1, 4, 2, 7, 8, 9, 5, -4, 23, 0, 8]\n+    k = 10\n+    ans = quick_select(a, k)\n+    if ans is not None:","path":"quick_select/quick_select.py","position":56,"original_position":56,"commit_id":"6cebff508d80d26cdeb70e3bdd38da06f8b44386","original_commit_id":"6cebff508d80d26cdeb70e3bdd38da06f8b44386","user":{"login":"Monal5031","id":21009189,"avatar_url":"https://avatars3.githubusercontent.com/u/21009189?v=3","gravatar_id":"","url":"https://api.github.com/users/Monal5031","html_url":"https://github.com/Monal5031","followers_url":"https://api.github.com/users/Monal5031/followers","following_url":"https://api.github.com/users/Monal5031/following{/other_user}","gists_url":"https://api.github.com/users/Monal5031/gists{/gist_id}","starred_url":"https://api.github.com/users/Monal5031/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Monal5031/subscriptions","organizations_url":"https://api.github.com/users/Monal5031/orgs","repos_url":"https://api.github.com/users/Monal5031/repos","events_url":"https://api.github.com/users/Monal5031/events{/privacy}","received_events_url":"https://api.github.com/users/Monal5031/received_events","type":"User","site_admin":false},"body":"@Hsankesara Exactly why I'm requesting to add an else block here, and not printing in the function itself. By printing the error in main() you are reducing the flexibility of this code.","created_at":"2017-06-16T11:11:23Z","updated_at":"2017-06-16T11:11:23Z","html_url":"https://github.com/iiitv/algos/pull/301#discussion_r122419318","pull_request_url":"https://api.github.com/repos/iiitv/algos/pulls/301","_links":{"self":{"href":"https://api.github.com/repos/iiitv/algos/pulls/comments/122419318"},"html":{"href":"https://github.com/iiitv/algos/pull/301#discussion_r122419318"},"pull_request":{"href":"https://api.github.com/repos/iiitv/algos/pulls/301"}}},"pull_request":{"url":"https://api.github.com/repos/iiitv/algos/pulls/301","id":125861868,"html_url":"https://github.com/iiitv/algos/pull/301","diff_url":"https://github.com/iiitv/algos/pull/301.diff","patch_url":"https://github.com/iiitv/algos/pull/301.patch","issue_url":"https://api.github.com/repos/iiitv/algos/issues/301","number":301,"state":"open","locked":false,"title":"Added Quick Select [Python]","user":{"login":"Hsankesara","id":21009715,"avatar_url":"https://avatars0.githubusercontent.com/u/21009715?v=3","gravatar_id":"","url":"https://api.github.com/users/Hsankesara","html_url":"https://github.com/Hsankesara","followers_url":"https://api.github.com/users/Hsankesara/followers","following_url":"https://api.github.com/users/Hsankesara/following{/other_user}","gists_url":"https://api.github.com/users/Hsankesara/gists{/gist_id}","starred_url":"https://api.github.com/users/Hsankesara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hsankesara/subscriptions","organizations_url":"https://api.github.com/users/Hsankesara/orgs","repos_url":"https://api.github.com/users/Hsankesara/repos","events_url":"https://api.github.com/users/Hsankesara/events{/privacy}","received_events_url":"https://api.github.com/users/Hsankesara/received_events","type":"User","site_admin":false},"body":"<!--\r\nHi!\r\nThanks for considering contributing to this ever-growing list of algorithm and data structure implementations.\r\nYour contribution is valuable.\r\nIn order to help us evaluate PRs better, we ask you to have a look at the following declaration and check the points you agree with. ( [x] )\r\nPRs which don't agree to all the points mentioned below will be rejected. \r\nAlso make sure that this PR corresponds to one and only one issue. Write the issue number in the space provided below.\r\n-->\r\n\r\nFixes #292 \r\n\r\n\r\n#### By submitting this pull request I confirm I've read and complied with the below declarations.\r\n\r\n- [x] I have read the [Contribution guidelines](https://github.com/iiitv/algos/blob/master/CONTRIBUTING.md) and I am confident that my PR reflects them.\r\n- [x] I have followed the [coding guidelines](https://github.com/iiitv/algos/blob/master/CONTRIBUTING.md#cs) for this project.\r\n- [x] My code follows the [skeleton code structure](https://github.com/iiitv/algos/blob/master/CONTRIBUTING.md#sample).\r\n- [x] This pull request has a descriptive title. For example, `Added {Algorithm/DS name} [{Language}]`, not `Update README.md` or `Added new code`.\r\n- [x] This pull request will be closed if I fail to update it even once in a continuous time span of 7 days.\r\n","created_at":"2017-06-15T16:27:02Z","updated_at":"2017-06-16T11:11:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"38f5499c16044eaa1f4c134fe8e0d1118702a017","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/iiitv/algos/pulls/301/commits","review_comments_url":"https://api.github.com/repos/iiitv/algos/pulls/301/comments","review_comment_url":"https://api.github.com/repos/iiitv/algos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iiitv/algos/issues/301/comments","statuses_url":"https://api.github.com/repos/iiitv/algos/statuses/6cebff508d80d26cdeb70e3bdd38da06f8b44386","head":{"label":"Hsankesara:AddQuickSelect","ref":"AddQuickSelect","sha":"6cebff508d80d26cdeb70e3bdd38da06f8b44386","user":{"login":"Hsankesara","id":21009715,"avatar_url":"https://avatars0.githubusercontent.com/u/21009715?v=3","gravatar_id":"","url":"https://api.github.com/users/Hsankesara","html_url":"https://github.com/Hsankesara","followers_url":"https://api.github.com/users/Hsankesara/followers","following_url":"https://api.github.com/users/Hsankesara/following{/other_user}","gists_url":"https://api.github.com/users/Hsankesara/gists{/gist_id}","starred_url":"https://api.github.com/users/Hsankesara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hsankesara/subscriptions","organizations_url":"https://api.github.com/users/Hsankesara/orgs","repos_url":"https://api.github.com/users/Hsankesara/repos","events_url":"https://api.github.com/users/Hsankesara/events{/privacy}","received_events_url":"https://api.github.com/users/Hsankesara/received_events","type":"User","site_admin":false},"repo":{"id":86498173,"name":"algos","full_name":"Hsankesara/algos","owner":{"login":"Hsankesara","id":21009715,"avatar_url":"https://avatars0.githubusercontent.com/u/21009715?v=3","gravatar_id":"","url":"https://api.github.com/users/Hsankesara","html_url":"https://github.com/Hsankesara","followers_url":"https://api.github.com/users/Hsankesara/followers","following_url":"https://api.github.com/users/Hsankesara/following{/other_user}","gists_url":"https://api.github.com/users/Hsankesara/gists{/gist_id}","starred_url":"https://api.github.com/users/Hsankesara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hsankesara/subscriptions","organizations_url":"https://api.github.com/users/Hsankesara/orgs","repos_url":"https://api.github.com/users/Hsankesara/repos","events_url":"https://api.github.com/users/Hsankesara/events{/privacy}","received_events_url":"https://api.github.com/users/Hsankesara/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Hsankesara/algos","description":"Popular Algorithms and Data Structures implemented in popular languages","fork":true,"url":"https://api.github.com/repos/Hsankesara/algos","forks_url":"https://api.github.com/repos/Hsankesara/algos/forks","keys_url":"https://api.github.com/repos/Hsankesara/algos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Hsankesara/algos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Hsankesara/algos/teams","hooks_url":"https://api.github.com/repos/Hsankesara/algos/hooks","issue_events_url":"https://api.github.com/repos/Hsankesara/algos/issues/events{/number}","events_url":"https://api.github.com/repos/Hsankesara/algos/events","assignees_url":"https://api.github.com/repos/Hsankesara/algos/assignees{/user}","branches_url":"https://api.github.com/repos/Hsankesara/algos/branches{/branch}","tags_url":"https://api.github.com/repos/Hsankesara/algos/tags","blobs_url":"https://api.github.com/repos/Hsankesara/algos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Hsankesara/algos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Hsankesara/algos/git/refs{/sha}","trees_url":"https://api.github.com/repos/Hsankesara/algos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Hsankesara/algos/statuses/{sha}","languages_url":"https://api.github.com/repos/Hsankesara/algos/languages","stargazers_url":"https://api.github.com/repos/Hsankesara/algos/stargazers","contributors_url":"https://api.github.com/repos/Hsankesara/algos/contributors","subscribers_url":"https://api.github.com/repos/Hsankesara/algos/subscribers","subscription_url":"https://api.github.com/repos/Hsankesara/algos/subscription","commits_url":"https://api.github.com/repos/Hsankesara/algos/commits{/sha}","git_commits_url":"https://api.github.com/repos/Hsankesara/algos/git/commits{/sha}","comments_url":"https://api.github.com/repos/Hsankesara/algos/comments{/number}","issue_comment_url":"https://api.github.com/repos/Hsankesara/algos/issues/comments{/number}","contents_url":"https://api.github.com/repos/Hsankesara/algos/contents/{+path}","compare_url":"https://api.github.com/repos/Hsankesara/algos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Hsankesara/algos/merges","archive_url":"https://api.github.com/repos/Hsankesara/algos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Hsankesara/algos/downloads","issues_url":"https://api.github.com/repos/Hsankesara/algos/issues{/number}","pulls_url":"https://api.github.com/repos/Hsankesara/algos/pulls{/number}","milestones_url":"https://api.github.com/repos/Hsankesara/algos/milestones{/number}","notifications_url":"https://api.github.com/repos/Hsankesara/algos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Hsankesara/algos/labels{/name}","releases_url":"https://api.github.com/repos/Hsankesara/algos/releases{/id}","deployments_url":"https://api.github.com/repos/Hsankesara/algos/deployments","created_at":"2017-03-28T19:18:54Z","updated_at":"2017-04-09T05:19:04Z","pushed_at":"2017-06-16T10:44:35Z","git_url":"git://github.com/Hsankesara/algos.git","ssh_url":"git@github.com:Hsankesara/algos.git","clone_url":"https://github.com/Hsankesara/algos.git","svn_url":"https://github.com/Hsankesara/algos","homepage":"","size":180,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":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":"iiitv:master","ref":"master","sha":"f06d030ff3f12379815725bc5f6fa556808267d2","user":{"login":"iiitv","id":9347727,"avatar_url":"https://avatars2.githubusercontent.com/u/9347727?v=3","gravatar_id":"","url":"https://api.github.com/users/iiitv","html_url":"https://github.com/iiitv","followers_url":"https://api.github.com/users/iiitv/followers","following_url":"https://api.github.com/users/iiitv/following{/other_user}","gists_url":"https://api.github.com/users/iiitv/gists{/gist_id}","starred_url":"https://api.github.com/users/iiitv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iiitv/subscriptions","organizations_url":"https://api.github.com/users/iiitv/orgs","repos_url":"https://api.github.com/users/iiitv/repos","events_url":"https://api.github.com/users/iiitv/events{/privacy}","received_events_url":"https://api.github.com/users/iiitv/received_events","type":"Organization","site_admin":false},"repo":{"id":84344298,"name":"algos","full_name":"iiitv/algos","owner":{"login":"iiitv","id":9347727,"avatar_url":"https://avatars2.githubusercontent.com/u/9347727?v=3","gravatar_id":"","url":"https://api.github.com/users/iiitv","html_url":"https://github.com/iiitv","followers_url":"https://api.github.com/users/iiitv/followers","following_url":"https://api.github.com/users/iiitv/following{/other_user}","gists_url":"https://api.github.com/users/iiitv/gists{/gist_id}","starred_url":"https://api.github.com/users/iiitv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iiitv/subscriptions","organizations_url":"https://api.github.com/users/iiitv/orgs","repos_url":"https://api.github.com/users/iiitv/repos","events_url":"https://api.github.com/users/iiitv/events{/privacy}","received_events_url":"https://api.github.com/users/iiitv/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iiitv/algos","description":"Popular Algorithms and Data Structures implemented in popular languages","fork":false,"url":"https://api.github.com/repos/iiitv/algos","forks_url":"https://api.github.com/repos/iiitv/algos/forks","keys_url":"https://api.github.com/repos/iiitv/algos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iiitv/algos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iiitv/algos/teams","hooks_url":"https://api.github.com/repos/iiitv/algos/hooks","issue_events_url":"https://api.github.com/repos/iiitv/algos/issues/events{/number}","events_url":"https://api.github.com/repos/iiitv/algos/events","assignees_url":"https://api.github.com/repos/iiitv/algos/assignees{/user}","branches_url":"https://api.github.com/repos/iiitv/algos/branches{/branch}","tags_url":"https://api.github.com/repos/iiitv/algos/tags","blobs_url":"https://api.github.com/repos/iiitv/algos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iiitv/algos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iiitv/algos/git/refs{/sha}","trees_url":"https://api.github.com/repos/iiitv/algos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iiitv/algos/statuses/{sha}","languages_url":"https://api.github.com/repos/iiitv/algos/languages","stargazers_url":"https://api.github.com/repos/iiitv/algos/stargazers","contributors_url":"https://api.github.com/repos/iiitv/algos/contributors","subscribers_url":"https://api.github.com/repos/iiitv/algos/subscribers","subscription_url":"https://api.github.com/repos/iiitv/algos/subscription","commits_url":"https://api.github.com/repos/iiitv/algos/commits{/sha}","git_commits_url":"https://api.github.com/repos/iiitv/algos/git/commits{/sha}","comments_url":"https://api.github.com/repos/iiitv/algos/comments{/number}","issue_comment_url":"https://api.github.com/repos/iiitv/algos/issues/comments{/number}","contents_url":"https://api.github.com/repos/iiitv/algos/contents/{+path}","compare_url":"https://api.github.com/repos/iiitv/algos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iiitv/algos/merges","archive_url":"https://api.github.com/repos/iiitv/algos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iiitv/algos/downloads","issues_url":"https://api.github.com/repos/iiitv/algos/issues{/number}","pulls_url":"https://api.github.com/repos/iiitv/algos/pulls{/number}","milestones_url":"https://api.github.com/repos/iiitv/algos/milestones{/number}","notifications_url":"https://api.github.com/repos/iiitv/algos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iiitv/algos/labels{/name}","releases_url":"https://api.github.com/repos/iiitv/algos/releases{/id}","deployments_url":"https://api.github.com/repos/iiitv/algos/deployments","created_at":"2017-03-08T16:49:57Z","updated_at":"2017-06-16T00:34:02Z","pushed_at":"2017-06-16T10:58:24Z","git_url":"git://github.com/iiitv/algos.git","ssh_url":"git@github.com:iiitv/algos.git","clone_url":"https://github.com/iiitv/algos.git","svn_url":"https://github.com/iiitv/algos","homepage":"","size":185,"stargazers_count":218,"watchers_count":218,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":64,"mirror_url":null,"open_issues_count":49,"forks":64,"open_issues":49,"watchers":218,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/iiitv/algos/pulls/301"},"html":{"href":"https://github.com/iiitv/algos/pull/301"},"issue":{"href":"https://api.github.com/repos/iiitv/algos/issues/301"},"comments":{"href":"https://api.github.com/repos/iiitv/algos/issues/301/comments"},"review_comments":{"href":"https://api.github.com/repos/iiitv/algos/pulls/301/comments"},"review_comment":{"href":"https://api.github.com/repos/iiitv/algos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iiitv/algos/pulls/301/commits"},"statuses":{"href":"https://api.github.com/repos/iiitv/algos/statuses/6cebff508d80d26cdeb70e3bdd38da06f8b44386"}}}}
{"actor":{"display_login":"Monal5031"}}