sortlab
is a versatile sorting package that supports various data structures, such as number arrays and strings, and provides multiple popular sorting algorithms.
- Supports multiple data types: Number arrays, strings, etc.
- Multiple sorting algorithms: Insertion Sort, Selection Sort, Bubble Sort, etc.
- Easy to use: Simple API for integrating sorting functionality into your projects.
You can install sortlab
using npm:
npm install sortlab
Here are some examples of how to use sortlab
in your projects:
const { Sorter } = require('sortlab');
const numberArray = [34, 7, 23, 32, 5, 62];
const sorterInstance = new Sorter(numberArray);
const sortedArray = sorterInstance.bubbleSort();
console.log(`Bubble Sort: ${sortedArray}`);
const { Sorter } = require('sortlab');
const stringData = "sortexample";
const sorterInstance = new Sorter(stringData);
const sortedString = sorterInstance.selectionSort();
console.log(`Quick Sort: ${sortedString}`);
- Insertion Sort
- Selection Sort
- Bubble Sort
- Quick Sort
- More algorithms coming soon...
We welcome contributions! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.