Notas
big sorting

Conteúdo das notas (8)
Página 1
big sorting

Página 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;
}

Página 3
quick sort
Página 4
Counting Sort 2
Página 5
closest number
Página 6
closest number
Closest Number (application/pdf)
Página 7
Missing number
Missingnumber (application/pdf)
Página 8
sherlock and array
Informações
- Descrição
- Computer Science Notas sobre big sorting , criado por Gunjan Kumar em 03-05-2018.
- Criado por
- Gunjan Kumar
- Visualizações
- 0
- Avaliação