{"action":"created","comment":{"url":"https://api.github.com/repos/stlmp/stlmp/pulls/comments/142007473","pull_request_review_id":66314583,"id":142007473,"diff_hunk":"@@ -0,0 +1,33 @@\n+#include <bits/stdc++.h>\n+#include \"../sorting/quick.hpp\"\n+\n+using namespace std;\n+\n+int _binary_search(int n,int a[],int target){\n+    /*\n+        for optimal performance the array needs to be sorted so we run quick sort \n+        thus we make sure the array is sorted without having to check if it's sorted\n+        \n+        if we wanted to check  we can use is_sorted for algorithm header but it requires passing an array\n+        that accepts std::vector or std::array not C-like arrats\n+    */\n+    quick_sort(n,a);\n+    auto L = 0;\n+    auto R = n -1;","path":"src/search/binary.hpp","position":16,"original_position":16,"commit_id":"3f81fa6cfdf279de47ad102fcd91b0ac18033043","original_commit_id":"3f81fa6cfdf279de47ad102fcd91b0ac18033043","user":{"login":"manparvesh","id":6629115,"avatar_url":"https://avatars3.githubusercontent.com/u/6629115?v=4","gravatar_id":"","url":"https://api.github.com/users/manparvesh","html_url":"https://github.com/manparvesh","followers_url":"https://api.github.com/users/manparvesh/followers","following_url":"https://api.github.com/users/manparvesh/following{/other_user}","gists_url":"https://api.github.com/users/manparvesh/gists{/gist_id}","starred_url":"https://api.github.com/users/manparvesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manparvesh/subscriptions","organizations_url":"https://api.github.com/users/manparvesh/orgs","repos_url":"https://api.github.com/users/manparvesh/repos","events_url":"https://api.github.com/users/manparvesh/events{/privacy}","received_events_url":"https://api.github.com/users/manparvesh/received_events","type":"User","site_admin":false},"body":"use lowercase alphabets for variable names.","created_at":"2017-09-30T14:41:15Z","updated_at":"2017-09-30T14:43:43Z","html_url":"https://github.com/stlmp/stlmp/pull/22#discussion_r142007473","pull_request_url":"https://api.github.com/repos/stlmp/stlmp/pulls/22","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/stlmp/stlmp/pulls/comments/142007473"},"html":{"href":"https://github.com/stlmp/stlmp/pull/22#discussion_r142007473"},"pull_request":{"href":"https://api.github.com/repos/stlmp/stlmp/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/stlmp/stlmp/pulls/22","id":144029518,"html_url":"https://github.com/stlmp/stlmp/pull/22","diff_url":"https://github.com/stlmp/stlmp/pull/22.diff","patch_url":"https://github.com/stlmp/stlmp/pull/22.patch","issue_url":"https://api.github.com/repos/stlmp/stlmp/issues/22","number":22,"state":"open","locked":false,"title":"added binary_search and added README note","user":{"login":"radicalrafi","id":18233396,"avatar_url":"https://avatars0.githubusercontent.com/u/18233396?v=4","gravatar_id":"","url":"https://api.github.com/users/radicalrafi","html_url":"https://github.com/radicalrafi","followers_url":"https://api.github.com/users/radicalrafi/followers","following_url":"https://api.github.com/users/radicalrafi/following{/other_user}","gists_url":"https://api.github.com/users/radicalrafi/gists{/gist_id}","starred_url":"https://api.github.com/users/radicalrafi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radicalrafi/subscriptions","organizations_url":"https://api.github.com/users/radicalrafi/orgs","repos_url":"https://api.github.com/users/radicalrafi/repos","events_url":"https://api.github.com/users/radicalrafi/events{/privacy}","received_events_url":"https://api.github.com/users/radicalrafi/received_events","type":"User","site_admin":false},"body":"#### Short description of what this resolves:\r\nThis implement binary search it's a relatively easy to implement ,I suggest implementations start using generic paradigm (templates) instead of typed ones, I also suggest to use std::vector instead of C-like arrays for performance,memory safety and iterators .\r\nHacktoberfest :+1: \r\n#### Changes proposed in this pull request:\r\n\r\n- ...\r\n- ...\r\n\r\n**Fixes**: #\r\n\r\n---\r\n\r\nBefore submitting, pleqase check if your submission conforms with the following checklist:\r\n- [ ] Add tests for all implementations.\r\n- [x] Descriptive pull request message\r\n- [x] Descriptive commit messages\r\n- [x] write test cases as written in the test folder\r\n- [ ] use a formatter to format your code according to the google standards.\r\n- [x] folder names should contain underscores '_' instead of spaces\r\n- [ ] please write full and descriptive names for variables\r\n- [x] remove main function from the code and add the tests in the tests folder by creating a new file in a similar structure and similar name as others.\r\n- [x] keep your implementation to C++, and write the code in .hpp files\r\n- [x] tests are written in .cpp files\r\n","created_at":"2017-09-30T13:59:29Z","updated_at":"2017-09-30T14:43:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"32eed8a0a0b151e1177ccdd12a6544e04e83a781","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/stlmp/stlmp/pulls/22/commits","review_comments_url":"https://api.github.com/repos/stlmp/stlmp/pulls/22/comments","review_comment_url":"https://api.github.com/repos/stlmp/stlmp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stlmp/stlmp/issues/22/comments","statuses_url":"https://api.github.com/repos/stlmp/stlmp/statuses/3f81fa6cfdf279de47ad102fcd91b0ac18033043","head":{"label":"radicalrafi:master","ref":"master","sha":"3f81fa6cfdf279de47ad102fcd91b0ac18033043","user":{"login":"radicalrafi","id":18233396,"avatar_url":"https://avatars0.githubusercontent.com/u/18233396?v=4","gravatar_id":"","url":"https://api.github.com/users/radicalrafi","html_url":"https://github.com/radicalrafi","followers_url":"https://api.github.com/users/radicalrafi/followers","following_url":"https://api.github.com/users/radicalrafi/following{/other_user}","gists_url":"https://api.github.com/users/radicalrafi/gists{/gist_id}","starred_url":"https://api.github.com/users/radicalrafi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radicalrafi/subscriptions","organizations_url":"https://api.github.com/users/radicalrafi/orgs","repos_url":"https://api.github.com/users/radicalrafi/repos","events_url":"https://api.github.com/users/radicalrafi/events{/privacy}","received_events_url":"https://api.github.com/users/radicalrafi/received_events","type":"User","site_admin":false},"repo":{"id":105372801,"name":"stlmp","full_name":"radicalrafi/stlmp","owner":{"login":"radicalrafi","id":18233396,"avatar_url":"https://avatars0.githubusercontent.com/u/18233396?v=4","gravatar_id":"","url":"https://api.github.com/users/radicalrafi","html_url":"https://github.com/radicalrafi","followers_url":"https://api.github.com/users/radicalrafi/followers","following_url":"https://api.github.com/users/radicalrafi/following{/other_user}","gists_url":"https://api.github.com/users/radicalrafi/gists{/gist_id}","starred_url":"https://api.github.com/users/radicalrafi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radicalrafi/subscriptions","organizations_url":"https://api.github.com/users/radicalrafi/orgs","repos_url":"https://api.github.com/users/radicalrafi/repos","events_url":"https://api.github.com/users/radicalrafi/events{/privacy}","received_events_url":"https://api.github.com/users/radicalrafi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/radicalrafi/stlmp","description":"Implementation of data structures and algorithms in C++, like the Standard Template Library (STL)","fork":true,"url":"https://api.github.com/repos/radicalrafi/stlmp","forks_url":"https://api.github.com/repos/radicalrafi/stlmp/forks","keys_url":"https://api.github.com/repos/radicalrafi/stlmp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/radicalrafi/stlmp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/radicalrafi/stlmp/teams","hooks_url":"https://api.github.com/repos/radicalrafi/stlmp/hooks","issue_events_url":"https://api.github.com/repos/radicalrafi/stlmp/issues/events{/number}","events_url":"https://api.github.com/repos/radicalrafi/stlmp/events","assignees_url":"https://api.github.com/repos/radicalrafi/stlmp/assignees{/user}","branches_url":"https://api.github.com/repos/radicalrafi/stlmp/branches{/branch}","tags_url":"https://api.github.com/repos/radicalrafi/stlmp/tags","blobs_url":"https://api.github.com/repos/radicalrafi/stlmp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/radicalrafi/stlmp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/radicalrafi/stlmp/git/refs{/sha}","trees_url":"https://api.github.com/repos/radicalrafi/stlmp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/radicalrafi/stlmp/statuses/{sha}","languages_url":"https://api.github.com/repos/radicalrafi/stlmp/languages","stargazers_url":"https://api.github.com/repos/radicalrafi/stlmp/stargazers","contributors_url":"https://api.github.com/repos/radicalrafi/stlmp/contributors","subscribers_url":"https://api.github.com/repos/radicalrafi/stlmp/subscribers","subscription_url":"https://api.github.com/repos/radicalrafi/stlmp/subscription","commits_url":"https://api.github.com/repos/radicalrafi/stlmp/commits{/sha}","git_commits_url":"https://api.github.com/repos/radicalrafi/stlmp/git/commits{/sha}","comments_url":"https://api.github.com/repos/radicalrafi/stlmp/comments{/number}","issue_comment_url":"https://api.github.com/repos/radicalrafi/stlmp/issues/comments{/number}","contents_url":"https://api.github.com/repos/radicalrafi/stlmp/contents/{+path}","compare_url":"https://api.github.com/repos/radicalrafi/stlmp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/radicalrafi/stlmp/merges","archive_url":"https://api.github.com/repos/radicalrafi/stlmp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/radicalrafi/stlmp/downloads","issues_url":"https://api.github.com/repos/radicalrafi/stlmp/issues{/number}","pulls_url":"https://api.github.com/repos/radicalrafi/stlmp/pulls{/number}","milestones_url":"https://api.github.com/repos/radicalrafi/stlmp/milestones{/number}","notifications_url":"https://api.github.com/repos/radicalrafi/stlmp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/radicalrafi/stlmp/labels{/name}","releases_url":"https://api.github.com/repos/radicalrafi/stlmp/releases{/id}","deployments_url":"https://api.github.com/repos/radicalrafi/stlmp/deployments","created_at":"2017-09-30T13:46:37Z","updated_at":"2017-09-30T13:46:39Z","pushed_at":"2017-09-30T13:56:33Z","git_url":"git://github.com/radicalrafi/stlmp.git","ssh_url":"git@github.com:radicalrafi/stlmp.git","clone_url":"https://github.com/radicalrafi/stlmp.git","svn_url":"https://github.com/radicalrafi/stlmp","homepage":"http://manparvesh.com/stlmp","size":187,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"stlmp:master","ref":"master","sha":"9f8d35d8e67c14720c7efc6dea679ed7fac49fe3","user":{"login":"stlmp","id":29227755,"avatar_url":"https://avatars1.githubusercontent.com/u/29227755?v=4","gravatar_id":"","url":"https://api.github.com/users/stlmp","html_url":"https://github.com/stlmp","followers_url":"https://api.github.com/users/stlmp/followers","following_url":"https://api.github.com/users/stlmp/following{/other_user}","gists_url":"https://api.github.com/users/stlmp/gists{/gist_id}","starred_url":"https://api.github.com/users/stlmp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stlmp/subscriptions","organizations_url":"https://api.github.com/users/stlmp/orgs","repos_url":"https://api.github.com/users/stlmp/repos","events_url":"https://api.github.com/users/stlmp/events{/privacy}","received_events_url":"https://api.github.com/users/stlmp/received_events","type":"Organization","site_admin":false},"repo":{"id":91465809,"name":"stlmp","full_name":"stlmp/stlmp","owner":{"login":"stlmp","id":29227755,"avatar_url":"https://avatars1.githubusercontent.com/u/29227755?v=4","gravatar_id":"","url":"https://api.github.com/users/stlmp","html_url":"https://github.com/stlmp","followers_url":"https://api.github.com/users/stlmp/followers","following_url":"https://api.github.com/users/stlmp/following{/other_user}","gists_url":"https://api.github.com/users/stlmp/gists{/gist_id}","starred_url":"https://api.github.com/users/stlmp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stlmp/subscriptions","organizations_url":"https://api.github.com/users/stlmp/orgs","repos_url":"https://api.github.com/users/stlmp/repos","events_url":"https://api.github.com/users/stlmp/events{/privacy}","received_events_url":"https://api.github.com/users/stlmp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stlmp/stlmp","description":"Implementation of data structures and algorithms in C++, like the Standard Template Library (STL)","fork":false,"url":"https://api.github.com/repos/stlmp/stlmp","forks_url":"https://api.github.com/repos/stlmp/stlmp/forks","keys_url":"https://api.github.com/repos/stlmp/stlmp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stlmp/stlmp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stlmp/stlmp/teams","hooks_url":"https://api.github.com/repos/stlmp/stlmp/hooks","issue_events_url":"https://api.github.com/repos/stlmp/stlmp/issues/events{/number}","events_url":"https://api.github.com/repos/stlmp/stlmp/events","assignees_url":"https://api.github.com/repos/stlmp/stlmp/assignees{/user}","branches_url":"https://api.github.com/repos/stlmp/stlmp/branches{/branch}","tags_url":"https://api.github.com/repos/stlmp/stlmp/tags","blobs_url":"https://api.github.com/repos/stlmp/stlmp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stlmp/stlmp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stlmp/stlmp/git/refs{/sha}","trees_url":"https://api.github.com/repos/stlmp/stlmp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stlmp/stlmp/statuses/{sha}","languages_url":"https://api.github.com/repos/stlmp/stlmp/languages","stargazers_url":"https://api.github.com/repos/stlmp/stlmp/stargazers","contributors_url":"https://api.github.com/repos/stlmp/stlmp/contributors","subscribers_url":"https://api.github.com/repos/stlmp/stlmp/subscribers","subscription_url":"https://api.github.com/repos/stlmp/stlmp/subscription","commits_url":"https://api.github.com/repos/stlmp/stlmp/commits{/sha}","git_commits_url":"https://api.github.com/repos/stlmp/stlmp/git/commits{/sha}","comments_url":"https://api.github.com/repos/stlmp/stlmp/comments{/number}","issue_comment_url":"https://api.github.com/repos/stlmp/stlmp/issues/comments{/number}","contents_url":"https://api.github.com/repos/stlmp/stlmp/contents/{+path}","compare_url":"https://api.github.com/repos/stlmp/stlmp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stlmp/stlmp/merges","archive_url":"https://api.github.com/repos/stlmp/stlmp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stlmp/stlmp/downloads","issues_url":"https://api.github.com/repos/stlmp/stlmp/issues{/number}","pulls_url":"https://api.github.com/repos/stlmp/stlmp/pulls{/number}","milestones_url":"https://api.github.com/repos/stlmp/stlmp/milestones{/number}","notifications_url":"https://api.github.com/repos/stlmp/stlmp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stlmp/stlmp/labels{/name}","releases_url":"https://api.github.com/repos/stlmp/stlmp/releases{/id}","deployments_url":"https://api.github.com/repos/stlmp/stlmp/deployments","created_at":"2017-05-16T14:09:13Z","updated_at":"2017-09-30T10:58:45Z","pushed_at":"2017-09-30T13:59:30Z","git_url":"git://github.com/stlmp/stlmp.git","ssh_url":"git@github.com:stlmp/stlmp.git","clone_url":"https://github.com/stlmp/stlmp.git","svn_url":"https://github.com/stlmp/stlmp","homepage":"http://manparvesh.com/stlmp","size":187,"stargazers_count":6,"watchers_count":6,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"open_issues_count":5,"forks":10,"open_issues":5,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stlmp/stlmp/pulls/22"},"html":{"href":"https://github.com/stlmp/stlmp/pull/22"},"issue":{"href":"https://api.github.com/repos/stlmp/stlmp/issues/22"},"comments":{"href":"https://api.github.com/repos/stlmp/stlmp/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/stlmp/stlmp/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/stlmp/stlmp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stlmp/stlmp/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/stlmp/stlmp/statuses/3f81fa6cfdf279de47ad102fcd91b0ac18033043"}},"author_association":"NONE"}}
{"actor":{"display_login":"manparvesh"}}