题目:
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.
For example,
Given [0,1,0,2,1,0,1,3,2...
分类:
移动开发 时间:
2015-02-04 13:08:10
阅读次数:
256
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 ex...
分类:
其他好文 时间:
2015-02-03 17:13:39
阅读次数:
156
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 ...
分类:
其他好文 时间:
2015-02-03 09:36:45
阅读次数:
194
显然,GDT(global descriptor table)是系统与所有进程共用的。相对于 LDT(local descriptor table)则是进程独享的。GPRs、selector registers、stack pointers、eflags、LDT descriptor、CR3 构成了...
分类:
其他好文 时间:
2015-02-02 17:58:06
阅读次数:
235
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
HideTags
Linked List Two
Pointers
#pragma once
#include
using namespace std;
...
分类:
其他好文 时间:
2015-01-30 22:54:42
阅读次数:
174
Given a binary tree
struct TreeLinkNode {
TreeLinkNode *left;
TreeLinkNode *right;
TreeLinkNode *next;
}
Populate each next pointer to point to its next right node. If ...
分类:
其他好文 时间:
2015-01-30 22:54:04
阅读次数:
139
原题地址Populating Next Right Pointers in Each Node II(参见这篇文章)的简化版,代码不变代码: 1 void connect(TreeLinkNode *root) { 2 queue layer; 3 4 layer.push(root); ...
分类:
其他好文 时间:
2015-01-30 15:45:15
阅读次数:
108
The problem:Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous s...
分类:
其他好文 时间:
2015-01-29 14:00:12
阅读次数:
118
题目:
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
Here, we will use the in...
分类:
编程语言 时间:
2015-01-27 15:06:38
阅读次数:
145
这两个名字不同当然所代表的意思也就不同。我刚开始看到这就吓到了,主要是中文太博大精深了,整这样的简称太专业了,把人都绕晕了。从英文解释或中文全称看就比较容易理解。指针数组:array of pointers,即用于存储指针的数组,也就是数组元素都是指针数组指针:a pointer to an arr...
分类:
编程语言 时间:
2015-01-26 16:39:51
阅读次数:
193