题目链接:点击打开链接题意比較明显,不赘述。删除时能够把i-1转到根,把i+1转到根下则i点就在
根右子树 的左子树,且仅仅有i这一个 点#include#include#include#includeusing namespace std;#define
N 300500#define inf 1...
分类:
其他好文 时间:
2014-06-03 11:29:26
阅读次数:
277
题目大意: 同2993、 这题是根据棋盘,分别输出棋子的位置。解题思路:
模拟再模拟、我写了8000+B 你能信?我是多有耐心呢!代码: 1 #include 2 #include 3 #include 4 #include 5
#include 6 #include ...
分类:
其他好文 时间:
2014-06-03 09:05:24
阅读次数:
311
Given a linked list, determine if it has a
cycle in it.Follow up:Can you solve it without using extra space?/** *
Definition for singly-linked list. *...
分类:
其他好文 时间:
2014-05-30 16:08:05
阅读次数:
238
Given preorder and inorder traversal of a tree,
construct the binary tree.Note:You may assume that duplicates do not exist in
the tree./** * Definitio...
分类:
其他好文 时间:
2014-05-30 16:02:40
阅读次数:
289
Given a linked list, return the node where the
cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it
without using extra space?/**...
分类:
其他好文 时间:
2014-05-30 15:59:56
阅读次数:
249
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-05-30 15:07:49
阅读次数:
260
There areNchildren standing in a line. Each
child is assigned a rating value.You are giving candies to these children
subjected to the following requi...
分类:
其他好文 时间:
2014-05-30 15:04:58
阅读次数:
224
Say you have an array for which theithelement
is the price of a given stock on dayi.Design an algorithm to find the maximum
profit. You may complete a...
分类:
其他好文 时间:
2014-05-30 15:00:54
阅读次数:
335
Given a triangle, find the minimum path sum
from top to bottom. Each step you may move to adjacent numbers on the row
below.For example, given the fol...
分类:
其他好文 时间:
2014-05-30 14:59:37
阅读次数:
241
jdk1.4之后版本不需要设置Classpath变量。
如果在Classpath变量中没有添加当前路径,即 [.](无括号),在命令行中运行java Helloworld会出现错误:Error: Could not
find or load main class Helloworld这是由于指定了C...
分类:
编程语言 时间:
2014-05-30 14:54:11
阅读次数:
331