Algorithms icon indicating copy to clipboard operation
Algorithms copied to clipboard

Implement Binary Search

Open deutranium opened this issue 5 years ago • 12 comments

Implement Binary Search in a language of your choice.

Please read the contributing guidelines in CONTRIBUTING.md

Languages claimed/implemented:

  • [x] C (by @KyaBacchaHai )
  • [x] Python (by @deutranium )
  • [x] CPP (by @Rahul30032)
  • [x] Java (by @hackbansu)
  • [x] C (from scratch) (by @swapnil-satpathy)
  • [x] Go (by @codelixir)
  • [x] Dart (by @royzaa)

deutranium avatar Oct 01 '20 18:10 deutranium

Hey I can try implementing this in CPP, if that's okay can you assign this to me?

Rahul30032 avatar Oct 01 '20 18:10 Rahul30032

I'm adding this in Java.

hackbansu avatar Oct 01 '20 18:10 hackbansu

@Rahul30032 @hackbansu sure

deutranium avatar Oct 01 '20 18:10 deutranium

Created #45 with code in Java. Cheers :)

hackbansu avatar Oct 01 '20 18:10 hackbansu

after this issue was assigned to me, I found out a basic implementation of binarysearch in cpp was pushed so i implemented another problem statement mentioned in readme file in binaryseach folder i.e implementing binary search for a sorted array with duplicate elements. my output gives first and last index as well as its count.

Rahul30032 avatar Oct 01 '20 20:10 Rahul30032

@Rahul30032 yeah it was an issue at my end, I didn't check it. Thanks for implementing a different version and good job with the code!!

deutranium avatar Oct 01 '20 21:10 deutranium

Can you please assign it to me. I along with binary search will also implement lower_bound,upper_bound from scratch which are features of STL and also add functionalities for finding ceiling and floor

swapnil-satpathy avatar Oct 02 '20 18:10 swapnil-satpathy

@swapnil-satpathy sure and I'm guessing you're talking about an implementation in C.

But you should name it as binarySearch_scratch.c and don't remove the code present right now as it talks about the basic flow without going into intricacies.

I'll assign this to you

deutranium avatar Oct 02 '20 18:10 deutranium

Hey, can I implement this in golang?

codelixir avatar Oct 03 '21 11:10 codelixir

@codelixir sure go ahead!

inesane avatar Oct 03 '21 12:10 inesane

Hi, can I implement this in dart?

royzaa avatar Oct 15 '22 05:10 royzaa

@royzaa yes you can go ahead, I'll assign it to you

codelixir avatar Oct 16 '22 13:10 codelixir