1.0.4 • Published 3 months ago
@suryaannadurai/binary_search v1.0.4
Binary Search
This is a package that will be useful to get the searching value's index
In this i have used Binary search algorithm which will provide you the value with log(n) Time complexity which is much quicker than the ordinary linear search algorithm
In cases of any issues that you find , feel free to contribute that will be much appreciated.
It is open source and everyone can use and contribute and use it efficiently
Installation :
- npm i @suryaannadurai/binary_search
Demo :
import binary from "@suryaannadurai/binary_search"
console.log(binary([1,2,3] , 3)) // 2