![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构算法
灌水九段
Talk is cheap, show me the code
展开
-
面试题
题目记不太清了。。好像是这样,有个无限大的int数组 比如10000好了 里面的数按递增排列,数的大小范围已知,假设0-100,求每个数的个数。a[10000];int count[100]={0};for(int i=0,i{ count[a[i]]++; }貌似题目不是这个。。确实想不起来了。。原创 2009-01-08 17:26:00 · 591 阅读 · 0 评论 -
统计文件夹和文件个数的递归算法二
int m_iFolder;//文件夹数int m_iFile;//文件数void CCountFileDlg::SearchFolder(CString path){ if(SetCurrentDirectory(path) == TRUE) { CFileFind finder; BOOL bWorking = finder.FindFile(原创 2009-01-29 23:13:00 · 706 阅读 · 0 评论 -
strcat实现
char* __cdecl strcat(char * dst,const char * src) { char *cp = dst; while(*cp) cp++; while(*cp++ = *src++); return( dst );}转载 2008-12-08 03:01:00 · 682 阅读 · 0 评论 -
简易字符串排序算法
void StringSort(char *p[],int length){ int i,j; char const *ptemp1; char const *ptemp2; char *pswap; for (i=0;i { for (j=0;j { ptemp1 = p[j]; ptem原创 2008-12-13 15:12:00 · 703 阅读 · 0 评论 -
二叉查找树
<br />二叉查找树 (Binary Search Tree ),或者是一棵空树,或者是具有下列性质的二叉树 :若它的左子树不空,则左子树上所有结点的值均小于它的根结点的值;若它的右子树不空,则右子树上所有结点的值均大于它的根结点的值;它的左、右子树也分别为二叉排序树。转载 2011-01-05 13:06:00 · 685 阅读 · 0 评论