Skip to content

Binary Search Problem #256

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Deepak-Kambala
Copy link

Welcome to Dart community

Describe your change:

This PR adds an implementation of the Binary Search algorithm in Dart.

The function binarySearch() takes a sorted list of integers and a target value, and returns the index of the target if found, otherwise -1.

The algorithm uses the standard binary search approach with integer division (~/) to avoid overflow.

Includes example usage in the main function for demonstration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant