BubbleSort_Modofoed_Algorithm

Add to Favourites
Post to:

Description
Modified algorithm

Comments
Presentation Transcript Presentation Transcript

Modified Algorithm : Modified Algorithm Step 5 : set i and chk_counter to 0 Step 6 : while(iA[i] ) then do step10 through step13 else do step14 { Step10 : set temp = A[i] [value of A[j] is stored in a temporary variable ‘temp’] Step11 : set A[i] = A[j] Step12 : set A[j] = temp Step13 : set chk_counter = 1 } [ end of ‘if ’ condition ] Step14 : add 1 to j [ end of the inner loop ‘j’ ] } [ end of inside while loop ] Step15 : if( chk_counter = 0 ) then do step16 else go to step17 { Step16 : break or go to Step18 [ exit from while loop ] } Step17 : add 1 to i [ end of the outer while loop ] } Step18 : Print the array Step19 : 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