随笔分类 -  剑指offer:代码

摘要:1 /*cqueue.h*/ 2 #ifndef _CQUEUE_ 3 #define _CQUEUE_ 4 5 #include "cstack.h" 6 7 template 8 class CQueue 9 {10 public:11 CQueue(int queueSize);... 阅读全文
posted @ 2015-06-28 10:49 制造天堂 阅读(202) 评论(0) 推荐(0)
摘要:1 /*主函数:重建二叉树*/ 2 bool treeBuild(int *arrayBefore, int *arrayMiddle, int length, TreeNode * treeRoot) 3 { 4 int key; 5 int leftLenth = 0... 阅读全文
posted @ 2015-06-07 20:57 制造天堂 阅读(169) 评论(0) 推荐(0)
摘要:1 /*1.递归解决*/ 2 bool reversePrintA(List_Node * listNode) 3 { 4 if(NULL == listNode) 5 { 6 return false; 7 } 8 9 if(NULL != li... 阅读全文
posted @ 2015-06-07 19:59 制造天堂 阅读(184) 评论(0) 推荐(0)
摘要:1 bool Replace(char *String, int length) 2 { 3 int index; 4 int charNum; 5 int blankNum; 6 char *workPtr; 7 8 if(NULL == Str... 阅读全文
posted @ 2015-06-07 18:29 制造天堂 阅读(194) 评论(0) 推荐(0)
摘要:1 bool Find(const int *matrix, int rows, int columns, int number) 2 { 3 int key; 4 int indexRow; 5 int indexCol; 6 7 /*合法性检查*/ 8 ... 阅读全文
posted @ 2015-06-07 16:28 制造天堂 阅读(160) 评论(0) 推荐(0)