会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Ryan
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
3
4
5
6
7
8
9
10
11
···
23
下一页
2015年7月3日
C/C++内存对齐 ZZ
摘要: 这篇文章写得非常深入浅出。推荐。图需要到原博看。http://songlee24.github.io/2014/09/20/memory-alignment/下面是网易的一道笔试题:struct { uint32_t m1; char m2; } varray[2];以下哪些判断一定成立?(多选)s...
阅读全文
posted @ 2015-07-03 00:00 Ryan in C++
阅读(271)
评论(0)
推荐(0)
2015年6月27日
Effective C++ Notes
摘要: Item 07 : 为多态基类声明virtual析构函数 1 #include 2 using namespace std; 3 4 class Base { 5 public: 6 Base() : bValue(1) {} 7 virtual ~Base() { cout p...
阅读全文
posted @ 2015-06-27 14:34 Ryan in C++
阅读(215)
评论(0)
推荐(0)
简洁版2048
摘要: code: 1 // Original file by Jay Chan: 2 // https://gist.github.com/justecorruptio/9967738 3 4 #include 5 #include 6 #include 7 #include 8...
阅读全文
posted @ 2015-06-27 13:47 Ryan in C++
阅读(498)
评论(0)
推荐(0)
2015年6月19日
leetcode coding base
摘要: 1.Contains Duplicate2.Contains Duplicate II3.Contains Duplicate III
阅读全文
posted @ 2015-06-19 15:07 Ryan in C++
阅读(179)
评论(0)
推荐(0)
leetcode Ch4-Binary Tree & BFS & Divide/Conquer
摘要: 一、1.Lowest Common Ancestor 1 class Solution { 2 public: 3 TreeNode *lowestCommonAncestor(TreeNode *root, TreeNode *A, TreeNode *B) { 4 if ...
阅读全文
posted @ 2015-06-19 10:16 Ryan in C++
阅读(207)
评论(0)
推荐(0)
2015年6月17日
minimal sparse ruler problem 最少尺子刻度问题
摘要: 一个长度13的尺子,如果在1位置刻点可以量出1和12,13三种刻度.那么至少刻几个点,可以直接量出1-13所有的长度,分别刻在哪几个位置?注:必须是直接量。即在尺子上能找出一个1-13任意的整数长度。写了个没什么技术含量的dfs暴力求解。一个可行解是 1, 2, 6, 10。 1 #include ...
阅读全文
posted @ 2015-06-17 23:15 Ryan in C++
阅读(561)
评论(0)
推荐(0)
2015年6月13日
leetcode Ch1-Search
摘要: 一、 Binary Search 1 int binarySearch(vector &array, int target) 2 { 3 int lo = 0, hi = array.size() - 1; 4 while (lo target) 8 hi...
阅读全文
posted @ 2015-06-13 14:24 Ryan in C++
阅读(221)
评论(0)
推荐(0)
2015年6月12日
[NCH 1, 3]
摘要: Preview:1.Implement strStr()O(m*n): 1 class Solution 2 { 3 public: 4 int strStr(string haystack,string needle) 5 { 6 for(int i=0;i> su...
阅读全文
posted @ 2015-06-12 23:03 Ryan in C++
阅读(335)
评论(0)
推荐(0)
2015年6月11日
leetcode Ch2-Dynamic Programming II
摘要: 一、Longest Valid Parentheses方法一、一维DP 1 class Solution 2 { 3 public: 4 int longestValidParentheses(string s) 5 { 6 vector dp(s.size(),0)...
阅读全文
posted @ 2015-06-11 14:45 Ryan in C++
阅读(267)
评论(0)
推荐(0)
2015年6月4日
C/C++内存管理详解 ZZ
摘要: 内存管理是C++最令人切齿痛恨的问题,也是C++最有争议的问题,C++高手从中获得了更好的性能,更大的自由,C++菜鸟的收获则是一遍一遍的 检查代码和对C++的痛恨,但内存管理在C++中无处不在,内存泄漏几乎在每个C++程序中都会发生,因此要想成为C++高手,内存管理一关是必须要过 的,除非放弃C+...
阅读全文
posted @ 2015-06-04 10:51 Ryan in C++
阅读(330)
评论(0)
推荐(0)
上一页
1
···
3
4
5
6
7
8
9
10
11
···
23
下一页
公告