Bubble Sort in C++ Using Class
In this post, bubble sort is written in C++ using class. #include<iostream> using namespace std; class BubbleSort { int a[20]; public: int *bubblesort(int *, int); }; int* BubbleSort :: bubblesort( int a[], int n) { int i, j, t; for( i=0; i < n; i++) { for(j=0; j < n-i-1; j++) { if ( a[j] […]
Bubble Sort in C++ Using Class Read More »