摘要: From 剑指Offer 何海涛 著#include #include #include template class CStack { public: CStack(void); ~CStack(void); T& top(void)... 阅读全文
posted @ 2015-04-19 19:44 long#long 阅读(137) 评论(0) 推荐(0) 编辑
摘要: From 剑指Offer 何海涛 著#include #include #include templateclass CQueue { public: CQueue(void); ~CQueue(void); void appendTail(const... 阅读全文
posted @ 2015-04-19 17:33 long#long 阅读(134) 评论(0) 推荐(0) 编辑
摘要: From 剑指Offer 何海涛 著#include #include #include struct BinaryTreeNode { int m_nValue; BinaryTreeNode *m_pLeft; BinaryTreeNode *m_pRight;};Binary... 阅读全文
posted @ 2015-04-19 16:58 long#long 阅读(135) 评论(0) 推荐(0) 编辑
摘要: From 剑指Offer 何海涛 著#include #include struct ListNode { int m_nValue; ListNode *m_pNext;};void printListRecursively(const ListNode *pHead) { co... 阅读全文
posted @ 2015-04-19 15:35 long#long 阅读(113) 评论(0) 推荐(0) 编辑
摘要: From 剑指Offer 何海涛 著#include struct ListNode { int m_nValue; ListNode *m_pNext;};void AddToTail(ListNode **head, int value) { if(head != NULL) ... 阅读全文
posted @ 2015-04-19 15:07 long#long 阅读(133) 评论(0) 推荐(0) 编辑
摘要: From 剑指Offer 何海涛 著#include #include void replaceBlank(char *str, int length) { if(str != NULL && length > 0) { int numberOfBlank = 0; ... 阅读全文
posted @ 2015-04-19 14:23 long#long 阅读(119) 评论(0) 推荐(0) 编辑
摘要: From 剑指Offer 何海涛 著// 从右上角开始查找bool find(const int *matrix, int rows, int columns, int value) { if(matrix == NULL || rows = 0) { int curr = *(... 阅读全文
posted @ 2015-04-19 13:39 long#long 阅读(231) 评论(0) 推荐(0) 编辑
摘要: From 剑指Offer 何海涛 著// 不好的解法一: 只适用于单线程环境class Singleton1 { public: static Singleton1* getInstance(void) { if(instance == NULL) { ... 阅读全文
posted @ 2015-04-19 11:23 long#long 阅读(405) 评论(0) 推荐(0) 编辑
摘要: From 剑指Offer 何海涛 著#include #include class CMyString { public: CMyString(char *pData = NULL); CMyString(const CMyString &other); ... 阅读全文
posted @ 2015-04-19 00:11 long#long 阅读(139) 评论(0) 推荐(0) 编辑