Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Competitive Programming: Binary Search Documentation #2509

Closed

Conversation

ayushijindal
Copy link
Contributor

@ayushijindal ayushijindal commented Sep 24, 2021


Description 📜

Format: Documentation

Made the documentation on the binary search algorithm.

AIM

Added code to explain the algorithm and made documentation in the .md format

Acknowledgment

To my mentor @atarax665 helping me making commit and PR for this issue, a big shoutout to him 🥳

do let me know if there are still any more changes that need to be done👍
👍

Fixes #949


Type of change 📝

  • Audio (Should be in mp3 format Includes speech clarity, Concise ,Low distortion)
  • Video (Animations, screen-recordings, presentations and regular explanatory films are all possibilties etc)
  • Documentation (Content Creation in the form of codes or tutorials)
  • Other (If you choose other, Please mention changes below)

Domain of Contribution 📊

  • Competitive #Programming

Checklist ✅

  • I follow Contributing Guidelines & Code of conduct of this project.
  • I have performed a self-review of my own code or work.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generates no new warnings.
  • I'm GWOC'21 contributor

Screenshots / Gif (Optional) 📸


anandhu720 and others added 30 commits September 17, 2021 10:54
This Contains information about what is a programming language and brief information about different types of programming language
[structure] : Redefine, Rename files, Sections Added
Signed-off-by: Asmit2952 <[email protected]>
Python: 1.4 What is a programming language? girlscript#77
…oject_Mentorship_Program

4.14 Open Mainframe Project Mentorship Program
OpenSource : 4.10 Explain everything related to Free Software Foundation (FSF)
adityabisoi and others added 15 commits September 19, 2021 21:15
Create What_is_an_object_in_Python.md
* Delete issue-assign.yml

* Delete Issue_watcher.yaml

* Update greetings.yml
…opment_React_Angular_Vue

merge: Frontend web development react angular vue
update bot to limit to 3 max issues being assigned to a single user
* Delete issue-assign.yml

* Delete Issue_watcher.yaml

* Update greetings.yml

* Create issue-assign.yml

* Update greetings.yml

* Update greetings.yml

* Update greetings.yml

* Update greetings.yml

* Fixed Java & Python mismatch

* Update ISSUE_TEMPLATE.md

* Update PULL_REQUEST_TEMPLATE.md

* Update issue-assign.yml

* Update ISSUE_TEMPLATE.md

* Update keylabeler.yml

* Update PULL_REQUEST_TEMPLATE.md

* Delete ISSUE_TEMPLATE.md

* Create issue-form.yml

* Update PULL_REQUEST_TEMPLATE.md

* Update keylabeler.yml

* Update PULL_REQUEST_TEMPLATE.md

* Hashtag check

* Update PULL_REQUEST_TEMPLATE.md

* Update issue-form.yml

* Update keylabeler.yml

* Update PULL_REQUEST_TEMPLATE.md

* Update keylabeler.yml
@keywordlabeler keywordlabeler bot added Audio Audio Format Competitive Programming documentation Improvements or additions to documentation Video labels Sep 24, 2021

#### Code in C++:

```c
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add pseudo-code of binary search.


---
<p align="center">
<img width="460" height="300" src="https://miro.medium.com/max/247/1*fMQ2cLdIEr3DoHitYyiSsg.png">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please use a clearer image? And please give image credit if you are using an image from a different source.

}
```

## Binary Search Problems
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Binary Search Problems
## Some common binary search problems


## Binary Search Problems
### Question:
### Find the index of first 1 in a sorted array of 0’s and 1’s if 1 is not present in the array print -1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Find the index of first 1 in a sorted array of 0’s and 1’s if 1 is not present in the array print -1
### Find the index of first 1 in a sorted array of 0’s and 1’s if 1 is not present in the array then print -1

## End Note
Hope this documentation provided you some basic idea about binary search algorithm and how to solve questions using this approach.
Binary search runs in logarithmic time in the worst case, making O(log n) comparisons, where n is the number of elements in the array.Binary search is faster than linear search except for small arrays. However, the array must be sorted first to be able to apply binary search. There are specialized data structures designed for fast searching, such as hash tables, that can be searched more efficiently than binary search. However, binary search can be used to solve a wider range of problems, such as finding the next-smallest or next-largest element in the array relative to the target even if it is absent from the array.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these extra blank lines.

@ayushijindal
Copy link
Contributor Author

Ok I will do the changes ASAP

@ayushijindal
Copy link
Contributor Author

@atarax665 I have made the required modifications. If it still needs further changes then kindly inform me 😃

@atarax665
Copy link
Contributor

Please do not merge the main branch with mybranch as you are making a contribution to the Competitive_Programming branch which is not synced with the main branch.

@ayushijindal
Copy link
Contributor Author

@atarax665 Can you assist me in making this issue resolved?

@ayushijindal ayushijindal deleted the mybranch branch September 29, 2021 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Audio Audio Format Competitive Programming documentation Improvements or additions to documentation Video
Projects
None yet
Development

Successfully merging this pull request may close these issues.