上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 17 下一页
摘要: 将数组重新排序以构造最小值 题目描述 给定一个整数数组,请将其重新排序,以构造最小值。 样例 给定[3,32,321],通过将数组重新排序,可构造6个可能性的数字: 3+32+321=332321 3+321+32=332132 32+3+321=323321 32+321+3=323213 321 阅读全文
posted @ 2016-08-22 12:18 HorseShoe2016 阅读(676) 评论(0) 推荐(0) 编辑
摘要: 克隆二叉树 题目描述 深度复制一个二叉树。 给定一个二叉树,返回一个它的克隆品。 样例 给定一个二叉树: 1 / \ 2 3 / \ 4 5 返回其相同结构相同数值的克隆二叉树: 1 / \ 2 3 / \ 4 5 Java算法实现 public class Solution { / @param 阅读全文
posted @ 2016-08-22 11:52 HorseShoe2016 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 问题描述 Suppose we abstract our file system by a string in the following manner: The string "dir\n\tsubdir1\n\tsubdir2\n\t\tfile.ext" represents: dir sub 阅读全文
posted @ 2016-08-21 15:33 HorseShoe2016 阅读(451) 评论(0) 推荐(0) 编辑
摘要: 问题描述 Given a string, find the first non repeating character in it and return it's index. If it doesn't exist, return 1. Examples: s = "leetcode" retur 阅读全文
posted @ 2016-08-21 15:15 HorseShoe2016 阅读(604) 评论(0) 推荐(0) 编辑
摘要: 问题描述 Given an integer n, return 1 n in lexicographical order. For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9]. Please optimize your alg 阅读全文
posted @ 2016-08-21 15:07 HorseShoe2016 阅读(442) 评论(1) 推荐(0) 编辑
摘要: 原题地址:https://code.google.com/codejam/contest/90101/dashboard#s=p0 题目描述: 算法代码: 阅读全文
posted @ 2016-08-20 17:36 HorseShoe2016 阅读(341) 评论(0) 推荐(0) 编辑
摘要: Java修饰符类型(public,protected,private,friendly) public的类、类属变量及方法,包内及包外的任何类均可以访问;protected的类、类属变量及方法,包内的任何类,及包外的那些继承了此类的子类才能访问;private的类、类属变量及方法,包内包外的任何类均 阅读全文
posted @ 2016-08-18 10:42 HorseShoe2016 阅读(6117) 评论(0) 推荐(0) 编辑
摘要: 今天使用Android的LocationManager制作了一款获取当前经纬坐标位置的软件。 LocationManager获取的只是经纬坐标点,为了解析出当前经纬坐标点的实际位置,可以使用Google提供的 Geocoding API 服务。 谷歌提供了一套 Geocoding API,使用它的话 阅读全文
posted @ 2016-08-15 15:56 HorseShoe2016 阅读(8125) 评论(0) 推荐(0) 编辑
摘要: 原文地址:http://www.cnblogs.com/wynet/p/5526905.html 这里介绍两种播放资源文件的方法: 第一种、 assets类资源放在工程根目录的assets子目录下,它里面保存的是一些原始的文件,可以以任何方式来进行组织。这些文件最终会被原装不动地打包在apk文件中。 阅读全文
posted @ 2016-08-14 11:57 HorseShoe2016 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 今天网上看到一个神算法,惊异不已,遂摘录于下: 原文地址:http://blog.csdn.net/sanniao/article/details/47106713 第一步不考虑进位,对每一位相加。0加0与 1加1的结果都0,0加1与1加0的结果都是1。我们可以注意到,这和异或的结果是一样的。对异或 阅读全文
posted @ 2016-08-13 10:25 HorseShoe2016 阅读(322) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 17 下一页