![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C-prime
文章平均质量分 66
sybilxxi
记录学习过程中的一些些思考
展开
-
用迭代和递归分别计算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 · 2121 阅读 · 0 评论 -
二分查找 (循环、递归两种方法)
二分查找 (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 · 277 阅读 · 0 评论 -
前缀表达式转后缀表达式的链栈实现
Infix to PostFix (stack -- Linked List Implementation)预备知识:栈:限定仅在表尾进行插入和删除,后进先出Stack Modeltypedef char StackElementType;typedef struct stackNode *Stack;struct stackNode{ StackElementType原创 2017-10-23 10:50:32 · 1475 阅读 · 0 评论 -
数组的链表实现:创建(头插/尾插)、打印、删除、插入
链表操作原创 2017-10-17 07:35:11 · 309 阅读 · 0 评论