码迷,mamicode.com
首页 >  
搜索关键字:pointer to pointer    ( 2176个结果
C++11 type_traits 之is_pointer,is_member_function_pointer源码分析
源码如下: template struct __is_pointer_helper : public false_type { }; template struct __is_pointer_helper : public true_type { }; /// is_p...
分类:编程语言   时间:2014-12-08 12:06:01    阅读次数:200
【LeetCode】Populating Next Right Pointers in Each Node
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set t...
分类:其他好文   时间:2014-12-05 22:47:04    阅读次数:271
Copy List with Random Pointer复制带有随机指针的链表
这道题目很经典,很多书和OJ里都有。如果初次遇到,一定很难搞定。再看其解法,实在是很惊艳。 有两个可以得到深刻启示的地方: (1)冗余的思想。谈到复制,我们往往都会另起炉灶,而不会原来链表上搞来搞去,感觉很复杂很危险,会一团糟。美错,最危险的地方就是最安全的地方。 (2)指针的步伐。这里的指针有一走两步的操作,很容易导致RE。但是否意味着每步都要仔细考虑指针越界?不然,那样程序会写的很累很乱...
分类:其他好文   时间:2014-12-05 12:50:51    阅读次数:165
Copy List with Random Pointer
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy ...
分类:其他好文   时间:2014-12-03 13:47:22    阅读次数:151
[leetcode]Populating Next Right Pointers in Each Node
问题描述: Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its next right nod...
分类:其他好文   时间:2014-12-03 00:30:06    阅读次数:198
【LeetCode】Container With Most Water 解题报告
【题目】 Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i,...
分类:其他好文   时间:2014-12-02 10:38:56    阅读次数:170
kernel panic 分析(NULL pointer dereference)
It is another typical kernel panic due to invalid address.Panic log:[ 20.896935] c3 554 (netd) Unable to handle kernel NULL pointer dereference at v.....
分类:其他好文   时间:2014-12-01 12:43:30    阅读次数:355
二叉树四种遍历非递归
1 void levelOrder(Bitree* root){ 2 queue nodeQueue; 3 Node* pointer=root; 4 if(pointer){ 5 nodeQueue.push(pointer); 6 } 7 ...
分类:其他好文   时间:2014-11-26 22:28:44    阅读次数:211
effective c++ 条款03 整理
尽可能使用const (1)const约束指针、迭代器 const char* p = "adc"; //non-const pointer,const data char* const p = "abc"; //const pointer,non-const data const char* const p = "abc";//const pointer,const data const s...
分类:编程语言   时间:2014-11-26 20:59:52    阅读次数:169
[leetcode]Longest Substring with At Most Two Distinct Characters
很明显的2 pointer问题。。。当满足条件的时候后面的指针加,不满足条件的时候前面的指针加,直到满足条件。。。class Solution {public: int lengthOfLongestSubstringTwoDistinct(string s) { int sta...
分类:其他好文   时间:2014-11-26 16:10:45    阅读次数:336
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!