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

[FEATURE REQUEST] Add Ubiquitous Binary Search #5851

Open
anijit18 opened this issue Oct 15, 2024 · 1 comment
Open

[FEATURE REQUEST] Add Ubiquitous Binary Search #5851

anijit18 opened this issue Oct 15, 2024 · 1 comment

Comments

@anijit18
Copy link

What would you like to Propose?

The “Ubiquitous Search Algorithm” would typically refer to a straightforward search method where we converge the search space till 'l' and 'r' points single element. If the middle location falls in the first pulse, the condition (A[m] < A[r]) doesn’t satisfy, we converge our search space to A[m+1 … r]. If the middle location falls in the second pulse, the condition (A[m] < A[r]) satisfied, we converge our search space to A[1 … m]. At every iteration we check for search space size, if it is 1, we are done.

-> Worst-case performance Θ(N)
-> Best-case performance O(1)
-> Average-case performance Θ(log(N))

Issue details

We are handling the corner cases in the present in the Binary Search in more effecient way in Ubiquitous Binary Search.

Additional Information

No response

@subham-behera
Copy link

@anijit18 I would like to work on the following issue.

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

No branches or pull requests

2 participants