Given a triangle, find the minimum path sum from top to bottom. Each step you maymove to adjacent numbers on the row below.For example, given the fol....
分类:
其他好文 时间:
2014-06-27 16:29:58
阅读次数:
188
11.1这道题要注意使用了line strip,由于曾经一直用triangle list,所以在几何渲染的时候easy算错定点描绘的顺序。贴一些代码,大概就能把这个问题解释清楚了,由于框架还不是特别熟,所以是在原有样例的基础上建立的自己的代码void TreeBillboardApp::BuildC...
分类:
其他好文 时间:
2014-06-25 17:11:30
阅读次数:
462
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-06-24 18:56:54
阅读次数:
240
Given numRows, generate the first
numRows of Pascal's triangle.
For example, given numRows = 5,
Return
[
[1],
[1,1],
[1,2,1],
[1,3,3,1],
[1,4,6,4,1]
]
解题思路:
杨辉三角没什么好说的...
分类:
其他好文 时间:
2014-06-22 22:48:11
阅读次数:
305
Given an index k, return the
kth row of the Pascal's triangle.
For example, given k = 3,
Return [1,3,3,1].
Note:
Could you optimize your algorithm to use only
O(k) extra space?
...
分类:
其他好文 时间:
2014-06-22 21:31:26
阅读次数:
214
最近需要用到三角网格生成的一些东西,所以就把TRIANGLE这个库编译了一下,发现编译过程还是稍微有些纠结,于是就想到写下来,希望以后有些童鞋看到少走一些弯路。
首先非常感谢eryar的帮助,非常感谢!
在编译之前还是先看一下eryar的博文:
http://www.cnblogs.com/opencascade/p/3632705.html
我是在...
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 following triangle
[
[2],...
分类:
其他好文 时间:
2014-06-22 17:07:52
阅读次数:
166
Triangle: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, give...
分类:
其他好文 时间:
2014-06-21 07:02:07
阅读次数:
203
Given an index k, return the kth row of the Pascal's triangle.
For example, given k = 3,
Return [1,3,3,1].
Note:
Could you optimize your algorithm to use only O(k) extra space?
思路:最简单的方法就是按...
分类:
其他好文 时间:
2014-06-18 12:40:54
阅读次数:
265
非常easy的一道DP,看到空间限制是O(N)的,不要习惯性的以为是要保存每一行的最小值,不难想到是要保存一行其中各个数为路径终点时的和的大小。当算到最后一行时,就是从顶部究竟部以这个底部位置为终点的最短路径和,找一个最小的就能够了。实现的时候要注意个问题,由于计算时要用到上一行的数据,所以为了避免...
分类:
其他好文 时间:
2014-06-17 20:05:36
阅读次数:
212