Notes
big sorting

Content of the notes (8)
Page 1
big sorting

Page 2
insertion sort
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
void insertionSort(int n, int *a) {
int temp,i,j,k;
for(j=1;j<n;j++)
{
temp=a[j];
i=j-1;
while(i>=0&&a[i]>temp)
{
a[i+1]=a[i];
i--;
for(k=0;k<n;k++)
cout<<a[k]<<" ";
cout<<endl;
}
a[i+1]=temp;
}
for(k=0;k<n;k++)
cout<<a[k]<<" ";
}
int main(void) {
int n;
cin>>n;
int a[n], i;
for(i = 0; i < n; i++) {
cin>>a[i];
}
insertionSort(n,a);
return 0;
}

Page 3
quick sort
Page 4
Counting Sort 2
Page 5
closest number
Page 6
closest number
Closest Number (application/pdf)
Page 7
Missing number
Missingnumber (application/pdf)
Page 8
sherlock and array
Information
- Description
- Computer Science Note on big sorting , created by Gunjan Kumar on 03/05/2018.
- Created by
- Gunjan Kumar
- Views
- 0
- Rating