码迷,mamicode.com
首页 >  
搜索关键字:triangle    ( 1341个结果
POJ1163
The Triangle Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 40061   Accepted: 24133 Description 7 3 8 8 1 0 2 7 4 4 4 5 2 6 5 (Figure...
分类:其他好文   时间:2015-05-25 16:40:12    阅读次数:98
Java for LeetCode 118 Pascal's Triangle II
Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1].解题思路:注意,本题的k相当于上题的k+1,其他照搬即可,JAVA实现如下: pub...
分类:编程语言   时间:2015-05-24 17:21:09    阅读次数:174
选择排序法
public class Triangle{ public static int[] orderby(int[] nums,String str){ if(str.equalsIgnoreCase("desc")){ for(int i=0;inums[j]...
分类:编程语言   时间:2015-05-23 22:32:50    阅读次数:136
[leetcode 120]triangle 空间O(n)算法
1 题目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...
分类:编程语言   时间:2015-05-20 23:44:52    阅读次数:156
求矩阵的主对角线之和
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.Scanner;public class Triangle{ public sta.....
分类:其他好文   时间:2015-05-20 23:37:05    阅读次数:232
空心菱形
public class Triangle{ public static void main(String[] args){ printHollowRhombus(20);//size是最大间隔距离 } public static void printHollowRhomb...
分类:其他好文   时间:2015-05-20 00:04:13    阅读次数:194
Pascal's Triangle
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] ] vector> generate(int nu...
分类:其他好文   时间:2015-05-19 22:45:12    阅读次数:100
Pascal's Triangle II
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? 从后往前计算 //用一个数组滚...
分类:其他好文   时间:2015-05-19 22:39:04    阅读次数:151
【leetcode】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, given the fol...
分类:其他好文   时间:2015-05-19 18:15:53    阅读次数:94
leetcode_120题——Triangle (动态规划)
TriangleTotal Accepted:39052Total Submissions:143341My SubmissionsQuestionSolutionGiven a triangle, find the minimum path sum from top to bottom. Each...
分类:其他好文   时间:2015-05-19 10:16:34    阅读次数:92
1341条   上一页 1 ... 86 87 88 89 90 ... 135 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!