都是考查DFS。经典回溯算法,问题在于我对该类型的代码不熟悉,目前以参考别人的代码,然后加上自己的实现为主,通过类似的题目加强理解。一、给定一棵二叉树,判断是否存在从root到leaf的路径和等于给定值sum,存在返回true,否则返回false。思路:DFS。代码:
1 private b...
分类:
其他好文 时间:
2014-05-28 23:51:25
阅读次数:
389
问题来源于leetcode上的两道题 Path Sum I &&
II,分别写了两个dfs。1 void dfs(TreeNode node , int sum , ArrayList curPath)2 void
dfs(TreeNode node , int sum , boolean ifEx...
分类:
编程语言 时间:
2014-05-28 13:11:14
阅读次数:
361
commit
87f8ac21ca6d2d086984dfc39b1869dc51ecd36fAuthor: Vitasic Date: Tue Jun 26
15:43:38 2012 +0400 Add Fake Playersdiff --git a/src/server/game/...
分类:
数据库 时间:
2014-05-28 04:43:05
阅读次数:
409
一个系列三道题,我都不会做,google之答案。过了两道,第三道看不懂,放置,稍后继续。一、Best
Time to Buy and Sell Stock
I题目:一个数组表示一支股票的价格变换。要求只买卖一次,获得最大收益。思路:一开始我认为是寻找最大、最小值,但由于最大值不一定总是出现在最小值的...
分类:
其他好文 时间:
2014-05-28 01:21:52
阅读次数:
262
题目: Say you have an array for which the ith element
is the price of a given stock on day i. Design an algorithm to find the maximum
profit. You may co...
分类:
其他好文 时间:
2014-05-28 00:53:26
阅读次数:
338
这个是TRINTIY端的GM相关的代码。。可以作为参考使用,仅仅是一个载入命令 diff -r
3d55d9aa1fa9 -r 0dadcdc551ce src/server/game/Scripting/ScriptLoader.cpp ---
a/src/server/game/Scriptin...
分类:
其他好文 时间:
2014-05-27 16:18:25
阅读次数:
329
Phaser is a fun, free and fast 2D game framework
for making HTML5 games for desktop and mobile web browsers, supporting Canvas
and WebGL rendering.Pha...
分类:
Web程序 时间:
2014-05-26 19:44:52
阅读次数:
269
Given an array of non-negative integers, you
are initially positioned at the first index of the array.Each element in the
array represents your maximu...
分类:
其他好文 时间:
2014-05-26 18:46:20
阅读次数:
251
原题地址:https://oj.leetcode.com/problems/unique-binary-search-trees-ii/题意:接上一题,这题要求返回的是所有符合条件的二叉查找树,而上一题要求的是符合条件的二叉查找树的棵数,我们上一题提过,求个数一般思路是动态规划,而枚举的话,我们就考...
分类:
编程语言 时间:
2014-05-26 18:30:01
阅读次数:
256
最新石油软件目录表: Coade Tank v4.0
V2012(化学工业储油罐设计分析评估软件) SW6-2011 v1.0 1CD SW6 V7.05 压力容器计算软件 ...
分类:
其他好文 时间:
2014-05-26 17:52:52
阅读次数:
206