摘要:
From 剑指Offer 何海涛 著 int findMin(vector& nums) { if(nums.empty()) { return 0; } int left = 0; int right = nums... 阅读全文
摘要:
From 剑指Offer 何海涛 著#include #include #include template class CStack { public: CStack(void); ~CStack(void); T& top(void)... 阅读全文
摘要:
From 剑指Offer 何海涛 著#include #include #include templateclass CQueue { public: CQueue(void); ~CQueue(void); void appendTail(const... 阅读全文
摘要:
From 剑指Offer 何海涛 著#include #include #include struct BinaryTreeNode { int m_nValue; BinaryTreeNode *m_pLeft; BinaryTreeNode *m_pRight;};Binary... 阅读全文
摘要:
From 剑指Offer 何海涛 著#include #include struct ListNode { int m_nValue; ListNode *m_pNext;};void printListRecursively(const ListNode *pHead) { co... 阅读全文
摘要:
From 剑指Offer 何海涛 著#include struct ListNode { int m_nValue; ListNode *m_pNext;};void AddToTail(ListNode **head, int value) { if(head != NULL) ... 阅读全文
摘要:
From 剑指Offer 何海涛 著#include #include void replaceBlank(char *str, int length) { if(str != NULL && length > 0) { int numberOfBlank = 0; ... 阅读全文
摘要:
From 剑指Offer 何海涛 著// 从右上角开始查找bool find(const int *matrix, int rows, int columns, int value) { if(matrix == NULL || rows = 0) { int curr = *(... 阅读全文
摘要:
From 剑指Offer 何海涛 著// 不好的解法一: 只适用于单线程环境class Singleton1 { public: static Singleton1* getInstance(void) { if(instance == NULL) { ... 阅读全文
摘要:
From 剑指Offer 何海涛 著#include #include class CMyString { public: CMyString(char *pData = NULL); CMyString(const CMyString &other); ... 阅读全文