0% found this document useful (0 votes)
2 views

DSA ppt

Uploaded by

Tanish Soni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

DSA ppt

Uploaded by

Tanish Soni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Topic:-

Data Structure And Algorithm Bubble sort.


Presentation
Submitted To:-
Prof.Mayur Jagdale

Submitted By:-
Tanish Soni (CI-85)
Tanmay Trivedi(CI-87
1.What Is Bubble Sort ??

2.Algorithm In Bubble Sort.


NTENTS

3.Program For Bubble Sort.

4.Numerical For Example.


lgoritm Steps:-

.Compare the first two elements of the array.


.Swap them if the first is greater than second.
.Move to the next pair of the element and repeat step two.
.Continue the process for each pair of adjacent elements.
.Repeat the entire process for n-1 iterations
where n is the size of the array) or until no swaps are needed
ample:
put Array: 6,3,8,5,2
ss 1:

mpare 6 and 3 → Swap → 3, 6, 8, 5, 2


mpare 6 and 8 → No swap → 3, 6, 8, 5, 2
ompare 8 and 5 → Swap → 3, 6, 5, 8, 2
mpare 8 and 2 → Swap → 3, 6, 5, 2,8
ass 2:
Compare 3 and 6 → No swap → 3, 6, 5, 2, 8
Compare 6 and 5 → Swap → 3, 5, 6, 2, 8
Compare 6 and 2 → Swap → 3, 5, 2, 6, 8

ass 3:
Compare 3 and 5 → No swap → 3, 5, 2, 6, 8
Compare 5 and 2 → Swap → 3, 2, 5, 6, 8

ass 4:
Compare 3 and 2 → Swap → 2, 3, 5, 6, 8

Output: 2,3,5,6,8
T H A N K S

You might also like