Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Loading...
User Settings
close menu
Welcome to Scribd!
Upload
Read for free
FAQ and support
Language (EN)
Sign in
0 ratings
0% found this document useful (0 votes)
8 views
Bubble Sort
Uploaded by
harshit.gahlaut2005
Copyright:
© All Rights Reserved
Available Formats
Download
as TXT, PDF, TXT or read online from Scribd
Download
Save
Save Bubble Sort For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Bubble Sort
Uploaded by
harshit.gahlaut2005
0 ratings
0% found this document useful (0 votes)
8 views
1 page
Document Information
click to expand document information
Copyright
© © All Rights Reserved
Available Formats
TXT, PDF, TXT or read online from Scribd
Share this document
Share or Embed Document
Sharing Options
Share on Facebook, opens a new window
Facebook
Share on Twitter, opens a new window
Twitter
Share on LinkedIn, opens a new window
LinkedIn
Share with Email, opens mail client
Email
Copy link
Copy link
Did you find this document useful?
0%
0% found this document useful, Mark this document as useful
0%
0% found this document not useful, Mark this document as not useful
Is this content inappropriate?
Report
Copyright:
© All Rights Reserved
Available Formats
Download
as TXT, PDF, TXT or read online from Scribd
Download now
Download as txt, pdf, or txt
Save
Save Bubble Sort For Later
0 ratings
0% found this document useful (0 votes)
8 views
1 page
Bubble Sort
Uploaded by
harshit.gahlaut2005
Copyright:
© All Rights Reserved
Available Formats
Download
as TXT, PDF, TXT or read online from Scribd
Save
Save Bubble Sort For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download as txt, pdf, or txt
Jump to Page
You are on page 1
of 1
Search inside document
Fullscreen
#include <iostream>
using namespace std;
void bubblesort(int arr[], int n)
{
int temp;
for (int i = 0; i < n - 1; i++)
{
for (int j = n - 1; j > i; j--)
{
if (arr[j] < arr[j - 1])
{
temp = arr[j];
arr[j] = arr[j - 1];
arr[j - 1] = temp;
}
}
}
}
int main()
{
int arr[40];
int n;
cout << "Enter the no of elements in array" << endl;
cin >> n;
cout << "Enter the elements" << endl;
for (int j = 0; j < n; j++)
cin >> arr[j];
bubblesort(arr, n);
cout << "Sorted Array" << endl;
for (int i = 0; i < n; i++)
cout << arr[i] << " ";
return 0;
}
You might also like
Bubble Sort
Document
2 pages
Bubble Sort
harshit.gahlaut2005
No ratings yet
DS Lab 3
Document
6 pages
DS Lab 3
Evil Sight
No ratings yet
Afrizal David Maulana
Document
4 pages
Afrizal David Maulana
locod1140
No ratings yet
Afrizal David Maulana_231011403456
Document
4 pages
Afrizal David Maulana_231011403456
locod1140
No ratings yet
SC22B135(1)
Document
1 page
SC22B135(1)
lohithakruthika2004
No ratings yet
Bubble Sort
Document
2 pages
Bubble Sort
rohitk93639
No ratings yet
Notability Notes
Document
40 pages
Notability Notes
Mayank Saharan
No ratings yet
Quick Sort
Document
1 page
Quick Sort
harshit.gahlaut2005
No ratings yet
SORTING
Document
11 pages
SORTING
rakesh.yadav10111966
No ratings yet
Bubble Sort
Document
1 page
Bubble Sort
Yashi Gupta
No ratings yet
#Include Using Namespace Void Int
Document
3 pages
#Include Using Namespace Void Int
aasifaftab
No ratings yet
ПЗ 3 Захаров
Document
3 pages
ПЗ 3 Захаров
SafeAt4
No ratings yet
Lab No 2
Document
5 pages
Lab No 2
atiq.rehman1105
No ratings yet
Experiment 7
Document
2 pages
Experiment 7
adarsh23169049
No ratings yet
Bubble Sort
Document
20 pages
Bubble Sort
Yo boi Jogindar
No ratings yet
EXP12
Document
6 pages
EXP12
sakharam_gawade
No ratings yet
Insertion Sort
Document
1 page
Insertion Sort
harshit.gahlaut2005
No ratings yet
Bubble Sort Java 2.0
Document
1 page
Bubble Sort Java 2.0
hanukumar2007
No ratings yet
codes
Document
50 pages
codes
bezawadayashwitha
No ratings yet
Bubble
Document
22 pages
Bubble
Sehar Rizwan
No ratings yet
No Kegiatan Dan Latihan Script Bubble Sorting
Document
8 pages
No Kegiatan Dan Latihan Script Bubble Sorting
Ifan Suffa
No ratings yet
Q3
Document
5 pages
Q3
upwork.workspace
No ratings yet
Bai Giang Ptit
Document
27 pages
Bai Giang Ptit
giap200496
No ratings yet
Merging of Two Array
Document
12 pages
Merging of Two Array
Vineet Rajput
No ratings yet
Tayyab Khan DSA Lab Report 1
Document
13 pages
Tayyab Khan DSA Lab Report 1
cigila6437
No ratings yet
Bubble Sort : Copied
Document
6 pages
Bubble Sort : Copied
Malik Ghulam Hur
No ratings yet
Assignment 3 (2) 24ceb0b14
Document
20 pages
Assignment 3 (2) 24ceb0b14
sv24csb1a58
No ratings yet
DSA POST LAB REPORT
Document
8 pages
DSA POST LAB REPORT
ahtisham0100
No ratings yet
#Include
Document
6 pages
#Include
suman k m
No ratings yet
Code
Document
18 pages
Code
kisam78442
No ratings yet
15315
Document
41 pages
15315
Aman Kashniyal
No ratings yet
Lab Manual: Riphah International University
Document
40 pages
Lab Manual: Riphah International University
Moon Mughal
No ratings yet
dsa codes
Document
10 pages
dsa codes
bezawadayashwitha
No ratings yet
Nancy Week1
Document
34 pages
Nancy Week1
Vansh Gupta
No ratings yet
Soal 1 BubbleSort
Document
1 page
Soal 1 BubbleSort
clintonbilly23
No ratings yet
Code CTDL-GT
Document
28 pages
Code CTDL-GT
giap200496
No ratings yet
Exp-2 (B) Priyanshu Singhal
Document
2 pages
Exp-2 (B) Priyanshu Singhal
Priyanshu Singhal
No ratings yet
Record File - 15jULY
Document
3 pages
Record File - 15jULY
apashyamkirikiri1432
No ratings yet
Cpppranaydam
Document
34 pages
Cpppranaydam
Isha D
No ratings yet
Selection Sort
Document
1 page
Selection Sort
harshit.gahlaut2005
No ratings yet
dsa2
Document
30 pages
dsa2
anshulvashisht88
No ratings yet
Arrays: Bubble Sorting
Document
10 pages
Arrays: Bubble Sorting
Riddhim Sehgal
No ratings yet
Document 1
Document
4 pages
Document 1
aravindhbaleboina
No ratings yet
12. Basic Sorting Solutions
Document
2 pages
12. Basic Sorting Solutions
someshgondal2
No ratings yet
C++ Practical Program
Document
9 pages
C++ Practical Program
Raj Chauhan
No ratings yet
DSA Lab Task 3
Document
6 pages
DSA Lab Task 3
Abdul Rehman Abid
No ratings yet
Lab No 04
Document
4 pages
Lab No 04
2023msee7
No ratings yet
Dsa Assignment
Document
2 pages
Dsa Assignment
Yashal Ijaz
No ratings yet
20bit0206 VL2023240102178 Da02
Document
9 pages
20bit0206 VL2023240102178 Da02
Saieesh Mutyala
No ratings yet
Usdgg
Document
2 pages
Usdgg
Sohila Bahaa
No ratings yet
DSA Programs
Document
16 pages
DSA Programs
muskan11825
No ratings yet
Sort Codes
Document
4 pages
Sort Codes
f20201654
No ratings yet
Kamal Rohilla 2K18/CO/166 ADA Assignment 13 Apr. 2020
Document
10 pages
Kamal Rohilla 2K18/CO/166 ADA Assignment 13 Apr. 2020
kamal
No ratings yet
ADA Assignment PDF
Document
10 pages
ADA Assignment PDF
2K18/CO/166 KAMAL ROHILLA
No ratings yet
Arrays Sorts
Document
4 pages
Arrays Sorts
Parthsarthi Singh
No ratings yet
Insertion Sort
Document
2 pages
Insertion Sort
boven92583
No ratings yet
Jaatland
Document
2 pages
Jaatland
boven92583
No ratings yet
ADA Lab Abhi
Document
23 pages
ADA Lab Abhi
nandinitiwari1985
No ratings yet
Q.5 Write A Program of Bubble Sort
Document
25 pages
Q.5 Write A Program of Bubble Sort
Yogesh Sharma
No ratings yet
150+ C Pattern Programs
From Everand
150+ C Pattern Programs
Hernando Abella
No ratings yet