摘要:
# include # include struct BTNode { char data; struct BTNode * pLchild; //p是指针 L是左 child是孩子 struct BTNode * pRchild; }; void PostTraverseBTree(struct BTNode * pT); struct BTNode * Cr... 阅读全文
摘要:
# include void hannuota(int n, char A, char B, char C) { /* 如果是1个盘子 直接将A柱子上的盘子从A移到C 否则 先将A柱子上的n-1个盘子借助C移到B 直接将A柱子上的盘子从A移到C 最后将B柱子上的n-1个盘子借助A移到C */ if (1 ... 阅读全文
摘要:
# include //假定n的值是1或大于1的值 long f(long n) { if (1 == n) return 1; else return f(n-1) * n; } int main(void) { printf("%ld\n", f(100)); return 0; } 阅读全文
摘要:
# include # include typedef struct Queue { int * pBase; int front; int rear; }QUEUE; void init(QUEUE *); bool en_queue(QUEUE *, int val); //入队 void traverse_queue(QUEUE *); bool fu... 阅读全文
摘要:
# include long sum(int n) { if (1 == n) return 1; else return n + sum(n-1); } int main(void) { printf("%ld\n", sum(100)); return 0; } 阅读全文
摘要:
# include int FindPos(int * a, int low, int high); void QuickSort(int * a, int low, int high); int main(void) { int a[6] = {-2, 1, 0, -985, 4, -93}; int i; QuickSort(a, 0, 5); //第二个参数... 阅读全文