会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
long#long
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
下一页
2015年4月20日
{面试题8: 旋转数组的最小数字}
摘要: From 剑指Offer 何海涛 著 int findMin(vector& nums) { if(nums.empty()) { return 0; } int left = 0; int right = nums...
阅读全文
posted @ 2015-04-20 17:50 long#long
阅读(134)
评论(0)
推荐(0)
2015年4月19日
{面试题7: 使用两个队列实现一个栈}
摘要: From 剑指Offer 何海涛 著#include #include #include template class CStack { public: CStack(void); ~CStack(void); T& top(void)...
阅读全文
posted @ 2015-04-19 19:44 long#long
阅读(140)
评论(0)
推荐(0)
{面试题7: 用两个栈实现队列}
摘要: From 剑指Offer 何海涛 著#include #include #include templateclass CQueue { public: CQueue(void); ~CQueue(void); void appendTail(const...
阅读全文
posted @ 2015-04-19 17:33 long#long
阅读(138)
评论(0)
推荐(0)
{面试题6: 重建二叉树}
摘要: 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
阅读(140)
评论(0)
推荐(0)
{面试题5: 从尾到头打印链表}
摘要: 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
阅读(116)
评论(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
阅读(136)
评论(0)
推荐(0)
{面试题4: 替换空格}
摘要: 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
阅读(122)
评论(0)
推荐(0)
{面试题3: 二维数组中的查找 }
摘要: 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
阅读(235)
评论(0)
推荐(0)
{面试题2: 实现 Singleton 模式}
摘要: From 剑指Offer 何海涛 著// 不好的解法一: 只适用于单线程环境class Singleton1 { public: static Singleton1* getInstance(void) { if(instance == NULL) { ...
阅读全文
posted @ 2015-04-19 11:23 long#long
阅读(412)
评论(0)
推荐(0)
{面试题1: 赋值运算符函数}
摘要: From 剑指Offer 何海涛 著#include #include class CMyString { public: CMyString(char *pData = NULL); CMyString(const CMyString &other); ...
阅读全文
posted @ 2015-04-19 00:11 long#long
阅读(152)
评论(0)
推荐(0)
上一页
1
2
3
4
下一页
公告