• Bogo Sort is highly inefficient algorithm and sometimes referred as "stupid sort" based on generate and test paradigm. Function shuffle repeadetly generates random permutation of it's input until it finds one that is sorted. Bogo Sort is not suitable for real-world applications.

    Time Complexity: Average Case: O ((n +1)!) Worst Case: Is unbounded since there is no guarantee it will complete

    Type Parameters

    • TElement extends string | number

    Parameters

    • arr: TElement[]

      unsorted array

    Returns TElement[]

    sorted array

Generated using TypeDoc