Implement an algorithm to find the kth to last element of a singly linked list.Classical "Runner" Technique of linkedlist/*Use two pointers, forward o...
分类:
其他好文 时间:
2014-07-08 00:37:17
阅读次数:
315
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe...
分类:
其他好文 时间:
2014-07-07 23:09:49
阅读次数:
298
Problem Description:Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your pr...
分类:
其他好文 时间:
2014-07-07 15:46:01
阅读次数:
267
Problem Description:Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Popul...
分类:
其他好文 时间:
2014-07-07 15:45:18
阅读次数:
166
Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL.
分类:
其他好文 时间:
2014-07-03 23:46:37
阅读次数:
389
Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution stil...
分类:
其他好文 时间:
2014-07-03 20:34:46
阅读次数:
193
本文已经迁移到: http://cpp.winxgui.com/cn:garbage-collection-in-cplusplus使用智能指针(smart pointers) http://www.codeproject.com/cpp/garbage_collect.asp 原理:基...
分类:
编程语言 时间:
2014-06-29 19:12:03
阅读次数:
232
1 There are certain rules when using references: (Page 451)A reference must be initialized when it is created. (Pointers can be initialized at any ...
分类:
其他好文 时间:
2014-06-25 21:07:06
阅读次数:
275
里氏替换原则(Liskov Substitution Principle)表述为 "使用基类对象指针或引用的函数必须能够在不了解衍生类的条件下使用衍生类的对象。(Functions that use pointers or references to base classes must be abl...
分类:
其他好文 时间:
2014-06-19 07:24:20
阅读次数:
297
【题目】
Follow up for problem "Populating Next Right Pointers in Each Node".
What if the given tree could be any binary tree? Would your previous solution still work?
Note:
You may only use constant extra space.
For example,
Given the following binary tre...
分类:
其他好文 时间:
2014-06-08 15:46:22
阅读次数:
303