basic-dsa-algo

2.1.1 • Public • Published

Part-1

The Basic-DSA-Algo is a Node.js package that provides basic data structures and algorithms commonly used in computer science.

TABLE OF CONTENT

Installation ⚒️

You can install Basic-DSA-Algo using npm. Run the following command:

  npm install basic-dsa-algo

Package Structure 📂

       📁Package
        |--- 📝Components
              |--- Linear Search
              |--- Binary Search
              |--- Bubble Sort
              |--- Insertion Sort
              |
              |--- so on ➡️
        |--- index.js
        |--- package.json
        |--- LICENSE
        |--- README

Usage 💡

// importing function
const { binarySearch } = require('basic-dsa-algo');

const arr = [1, 3, 5, 7, 9];
const target = 5;

const index = binarySearch(arr, target);

if (index !== -1) {
    console.log(`Element ${target} found at index ${index}`);
} else {
    console.log(`Element ${target} not found in the array`);
}
Element 5 found at index 2

Package Sidebar

Install

npm i basic-dsa-algo

Weekly Downloads

1

Version

2.1.1

License

MIT

Unpacked Size

6.44 kB

Total Files

10

Last publish

Collaborators

  • abhinavkumar2369