![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
文章平均质量分 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 · 899 阅读 · 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 · 588 阅读 · 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 · 678 阅读 · 0 评论