Bubblesort_algorithm

Add to Favourites
Post to:

Description
Algorithm of the bubble sort

Comments
Presentation Transcript Presentation Transcript

Algorithm : Algorithm Let A[n] be an array required to be sorted in descending order : Step 1 : Start Step 2 : set i to 0 Step 3 : while(iA[i] ) then do step10 thru step12 else do step13 { Step10 : set temp = A[i] [value of a[j] is stored in a temporary variable ‘temp’] Step11 : A[i] = A[j] Step12 : A[j] = temp } [ end of ‘if ’ condition ] Step13 : add 1 to j [ end of the inner loop ‘j’ ] } Step14 : add 1 to i [ end of the outer loop ‘i’ ] } Step15 : Print the sorted array Step16 : end

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no:


Area code Number
Subjects you are interested in:
Word verification: (Enter the text as in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
5 Members Recommend
46 Followers

Your Facebook Friends on WizIQ

Give live classes, create & sell online courses

Try it free Plans & Pricing

Connect