随笔分类 -  计数排序

摘要://counting sort 计数排序//参考算法导论8.2节#include#include#include#includeusing namespace std;const int k=5;const int n=7;int a[n]={5, 5, 1, 2 , 5, 4, 1};int b[n];int c[k+1];int main(){ int maxn=0; mem... 阅读全文
posted @ 2014-06-11 10:19 katago 阅读(334) 评论(0) 推荐(0)
摘要:两种解法: 1.计数排序 //计数排序#include#include#include#includeusing namespace std;const int maxn=10001;int v[maxn], s[maxn];int main() { int N, Q; int Kase=0; while(cin>>N>>Q && N && Q) { ... 阅读全文
posted @ 2014-06-10 16:46 katago 阅读(159) 评论(0) 推荐(0)