自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 资源 (1)
  • 收藏
  • 关注

原创 Leetcode 64. Minimum Path Sum

//Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. public class Main { public static void main(S

2017-04-26 14:40:16 266

原创 Leetcode 63. Unique Paths II

// Follow up for "Unique Paths": // // Now consider if some obstacles are added to the grids. How many unique paths // would there be? // // An obstacle and empty space is marked as 1 and 0 respective

2017-04-25 17:23:18 198

原创 Leetcode 62. Unique Paths

//A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). // //The robot can only move either down or right at any point in time. The robot is trying to reach

2017-04-25 16:59:59 221

原创 Leetcode 61. Rotate List

// Given a list, rotate the list to the right by k places, where k is // non-negative. // // For example: // Given 1->2->3->4->5->NULL and k = 2, // return 4->5->1->2->3->NULL. public class Main {

2017-04-24 21:57:09 144

原创 Leetcode 60. Permutation Sequence

//输出第k的全排列 public class Main { public static void main(String[] args) throws Exception { System.out.println(getPermutation(4, 7)); } public static String getPermutation(int n, int k) {

2017-04-24 20:36:42 204

原创 Java 求整型数组的逆序数

如{7,5,6,4}的逆序数为5,可以使用归并排序来解决。 但是两个数组是从后向前进行比较,如果第一个数组的数字大于第二个数组当前的数字,就将第二个数组当前的数字位置数量就是对于数组1中当前数字的逆序数。 public class Main { public static void main(String[] args) throws Exception { int[] c

2017-04-22 08:28:34 3102

原创 Java 判断一个序列是否是搜索二叉树的后序遍历结果

//思路最后一个节点是二叉树的根节点,前面一些节点小于这个节点,后面节点大于这个节点 //如果后面一些节点有小于这个节点值的节点,那么就不是二叉搜索树的后序遍历,作为程序的退出点 //找到cut点,递归的执行这个函数 public class Main { public static void main(String[] args) { int[] array = { 5, 7, 6,

2017-04-15 18:46:30 1016

原创 Java 打印1到最大的n位数

//从1依次打印到n位最大数的值,如n=3,则打印1,2,3,...,999 public class Main { public static void main(String[] args) { int n = 2323; int[] array = new int[n]; if (n <= 0) return; printArray(array, 0); }

2017-04-09 17:12:02 316

原创 Java 重建二叉树

给出树的前序和中序遍历,重建二叉树 package com.bupt; import java.util.Arrays; import java.util.Stack; class Tree{ int data; Tree left; Tree right; } public class Main { public static Tree constructTree(int[]

2017-04-06 17:10:09 198

python 2.7.13 + numpy对应版本

python 2.7.13及numpy函数类库对应版本,直接双击安装即可

2017-05-20

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除