OPEN Your next idea starts with a note Explore the library →

Notes, code and ideas. All in one place.

Notex/Algorithms/Sorting Algorithms

Sorting Algorithms

Edit on GitHub ↗Always free to read

Sorting Algos

<--Back to Home

  • Stable Algorithm

Bubble Sort

for(int i=0;i<n-1;i++)
    {
            for(int j=0;j<n-1-i;j++)
            {
                if(a[j]>a[j+1])
                {
                    int temp=a[j];
                    a[j]=a[j+1];
                    a[j+1]=temp;
                }
            }

    }
KEEP EXPLORING

One note leads to another.

Back to the library →
⌕
Search across the entire library ⌘ K