Bubble Sort

  • Uploaded by: Muhammad Rana Farhan
  • 0
  • 0
  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Bubble Sort as PDF for free.

More details

  • Words: 55
  • Pages: 1
Bubble Sort #include void swap(int *p1,int *p2){ int hold; hold=*p1; *p1=*p2; *p2=hold; } void bubbleSort(int a[],const int size){ for(int pas=0;pas<size-1;pas++) for(int com=0;com<size-1;com++){ if(a[com]>a[com+1]) swap(&a[com],&a[com+1]); } } void main(){ const int size=10; int a[size]={20,50,100,10,30,70,40,90,80,60}; bubbleSort(a,size); for(int i=0;i<size;i++) cout<
Click the link below to see more examples URL: http://ravianeducation.blogspot.com E-Mail: [email protected] Farhan: 03008855006

Related Documents

Bubble Sort
May 2020 17
Bubble Sort
May 2020 22
Bubble Sort
June 2020 8
Bubble Sort With Flag
April 2020 16
Parallel Bubble Sort
May 2020 18

More Documents from "Wayan Sriyasa"

Factorial
June 2020 13
Lecture 10
June 2020 19
Scientific Calculator
June 2020 8
Intermediate Part Ii
June 2020 9
Intermediate Part Ii
June 2020 6