Have ideas to improve npm?Join in the discussion! »

    bubblesort-one-loop

    1.0.3 • Public • Published

    NPM version

    Bubble Sort with one loop, still with O(n^2) complexity.

    Why

    Why not? 
    

    Install

    $ npm i --save bubblesort-one-loop

    Usage

    var bubblesort = require('bubblesort-one-loop');
     
    bubblesort([5,4,3,2,1]); // => [1,2,3,4,5]
     
    function cmp(a, b) { return b - a; }
     
    bubblesort([1,2,3,4,5], cmp); // => [5,4,3,2,1]
     

    License

    MIT © Catalin Stochita

    Install

    npm i bubblesort-one-loop

    DownloadsWeekly Downloads

    1

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    1.51 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar