binary_search_by_trisha
v1.0.0
Published
Implementation of the Binary Search algorithm in JavaScript
Readme
Binary Search Package
A lightweight and efficient JavaScript library for performing binary search on sorted arrays. This package provides a simple way to find the index of a target value in a sorted array using the divide-and-conquer approach.
Features
🚀 Fast and efficient: Time complexity of O(logn). 📦 Lightweight: Minimalistic package for quick integration. 💻 Easy to use: Works seamlessly with any sorted array.
Installation and Use
- npm install binary_search_by_trisha
- After installation, you can import the binary search function const binarySearch = require("binary_search_by_trisha"); // or import binarySearch from "binary_search_by_trisha";
- Call the function and pass the argument binarySearch(arr: number[], target: number) => number
