diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b13f6b2..17867b7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,3 +15,6 @@ ### Himanshu Maurya - Github: https://github.com/mauryahimanshu + +### Sharannyo Basu + - Github: https://github.com/sharannyobasu \ No newline at end of file diff --git a/Data Structure/BubbleSort.cpp b/Data Structure/BubbleSort.cpp new file mode 100644 index 0000000..d6d6be7 --- /dev/null +++ b/Data Structure/BubbleSort.cpp @@ -0,0 +1,30 @@ +#include +using namespace std; +void bubble(int a[], int n) +{ + for (int i=1;ia[j+1]) + { + swap(a[j],a[j+1]); + } + } + } +} +int main() +{ + int n, key, arr[1000],i; + cin>>n; + cout<<"Enter elements of the array : "; + for(i =0;i>arr[i]; + } + bubble(arr,n); + for(i=0;i +using namespace std; +void insertion(int a[], int n) +{ + int i,j,e; + for(i=1;i=0 && a[j]>e) + { + a[j+1]=a[j]; + j--; + } + a[j+1]=e; + } +} +int main() +{ + int n, key, arr[1000],i; + cin>>n; + cout<<"Enter elements of the array : "; + for(i =0;i>arr[i]; + } + insertion(arr,n); + for(i=0;i +using namespace std; +int main() +{ + int n; + cin>>n; + int a[1000]; + int cs=0; + int ms=0; + for (int i=0;i>a[i]; + } + for(int i=0;i +#include +using namespace std; + +int main() { + int coins[]={1,2,5,10,20,50,100,200,500,2000}; + int size=sizeof(coins)/sizeof(int); + int n,max; + cout<<"Enter total money : "; + cin>>n; + while(n>0) + { + int i,j; + for(i=0;i +using namespace std; +int main() +{ + int a,i,sum,n,j; + int arr[1000]; + cin>>n; + for(i=0;i>arr[i]; + } + cout<<"Enter sum : "; + cin>>sum; + for(i=0;i +using namespace std; + +void countingsort(int *arr, int n, int div1) +{ + int output[n]; + int count[10]={0}; + + for(int i=0;i=0;i--) + { + output[--count[(arr[i]/div1)%10]]=arr[i]; + //count[(arr[i]/div1)%10]--; + } + for(int i=0;i0;div1*=10) + { + countingsort(arr, n, div1); + } +} + + +int main() +{ + int n; + cin>>n; + int arr[n]; + for(int i=0;i>arr[i]; + } + cout<<"Before sorting : "< +using namespace std; +void selection(int a[], int n) +{ + + for(int i=0;i>n; + cout<<"Enter elelemnts of the array : "; + for(i =0;i>arr[i]; + } + selection(arr,n); + for(i=0;i +using namespace std; +int main() +{ + int a[1000][1000]={0}; + int r,c,i,j; + cin>>r>>c; + for(i=0;i>a[i][j]; + } + } + for(i=0;i