aboutsummaryrefslogtreecommitdiff
path: root/CountingSort2.cpp
blob: 29fb91c05e75adc6270e031fc3bc319dbfee0835 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include<bits/stdc++.h>

using namespace std;

int main() {
  int n, x;
  cin >> n;
  vector<int> v;
  vector<int> freq(100);
  for(int i = 0; i < n; i ++){
    cin >> x;
    freq[x]+=1;
  }
  for(int i = 0; i < freq.size(); i++){
    for(int j = 0; j < freq[i]; j++){
      cout << i << " ";
    }
  }
  cout << endl;
  return 0;
}