- 博客(2)
- 资源 (1)
- 收藏
- 关注
原创 冒泡排序,选择排序,插入排序,堆排序,归并排序,快速排序
冒泡排序,时间复杂度O(n²) template void Bubble(T *a,int n) { for(int i=1;i<n-1;++i) for(int j=0;j<n-i;++j) if(a[j]<a[j+1]) swap(a[j],a[j+1]); } 冒泡排序的改进,及时终止冒泡排序 template void Bubble(T *a,
2012-10-22 10:33:51 263
原创 string类的简单实现
#include class string { public: string (const char *ch=NULL); string (const string &str); ~string(); const string operator + (const string &str); string &operator += (const
2012-10-06 14:04:57 247
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人