算法
文章平均质量分 67
paommmmm
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
字符串左移m位问题
//*求最大公约数*/ int max_common_div(int a,int b){ if(a<b){ a=a+b; b=a-b; a=a-b; } int t=a%b; while(t!=0){ a=b; b=t; t=a%b; } return b; } void left_move(){ const int m=4; char ch[]="abc原创 2013-04-05 17:15:47 · 955 阅读 · 0 评论 -
一种随机数生成算法
随机数生成类 class RandNumber{ static const unsigned long maxshort=65536L; static const unsigned long multiplier=1194211693L; static const unsigned long adder=12345L; unsigned long randSeed; public:原创 2013-05-24 14:38:56 · 654 阅读 · 0 评论 -
红黑树C/C++实现(附带一个set容器)
#include #include using namespace std; static const bool RED=true; static const bool BLACK=false; //tree node template class TNode{ public: TNode* p;//parent TNode* left;// left son TNode* rig原创 2013-05-24 14:29:05 · 730 阅读 · 0 评论
分享