Skip to content

A simple , efficient and es6 way to sort an array using quick sort and merge sort

License

Notifications You must be signed in to change notification settings

IntegerAlex/efficient-sorting

Repository files navigation

Efficient Sort Function in JavaScript

DeepScan grade DeepSource CodeScene Code Health NPM Downloads NPM Version

This project provides a JavaScript implementation of an efficient sorting function that dynamically determines the sorting method based on the characteristics of the input array.

Introduction

The goal of this project is to create a sorting function that intelligently selects the most suitable sorting algorithm based on the size and nature of the input array. By dynamically choosing between quicksort and mergesort, the function aims to optimize performance for different scenarios.

  • For now it only supports 1D array of any size

Installation

Install the efficient-sorting package using npm:

npm install efficient-sorting

Usage

    import Sort from 'efficient-sorting'
    let array = [10,20,45,2,1,19,17]
    console.log(Sort(array))

To use the sorting function in your JavaScript project, follow these steps:

  1. Clone the repository:

    git clone https://github.com/IntegerAlex/efficient-sorting.git