- 博客(4)
- 收藏
- 关注
原创 前缀表达式转后缀表达式的链栈实现
Infix to PostFix (stack -- Linked List Implementation) 预备知识: 栈:限定仅在表尾进行插入和删除,后进先出 Stack Model typedef char StackElementType; typedef struct stackNode *Stack; struct stackNode{ StackElementType
2017-10-23 10:50:32 1502
原创 二分查找 (循环、递归两种方法)
二分查找 (binary search) 循环实现 int BinarySearch(int *a,int len,int target) { int low,high,mid; low=0; high=len-1; while (low<=high) { mid=(low+high)/2; if (a[mid]==target)
2017-10-23 10:35:54 289
原创 用迭代和递归分别计算1+2+3+...+n
Using interation and recursion to accumulaterucursivePoint: f(n)=n+f(n-1) The function call itself until n==1, so we should judge when is the time that we have to stop call itself. Then, we haveif (n
2017-01-30 14:47:47 2140
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人