Sorting of an array in ascending order





Algorithm:



Step1: start

Step2: read the array to a

Step3: set j=0 and i=0

Step4: Repeat steps 5 and 6 while i<limit

Step5: Repeat step 6 while j<limit

Step6: if(a[i]<a[j])
       
        t=a[i]
        a[i]=a[j]
        a[j]=t

Step7: Print sorted array

Step8: stop


Comments

Popular posts from this blog

Node.js Cheat Sheet

Codeigniter ! Simple But Powerful

Enhancing Supply Chain Security and Cloud-Native Development with Chainguard