- 博客(12)
- 收藏
- 关注
原创 Java sort 源码解析 Object part
上次分析了Java对primitive的排序,使用的是优化的快速排序算法。这次介绍Java对Object对象(Comparable)的排序。Java使用了归并对Object排序,关于归并排序的细节,请查看http://zh.wikipedia.org/zh/%E5%BD%92%E5%B9%B6%E6%8E%92%E5%BA%8F归并排序也有一个运行状态图,不过看着确实挺费解的 =。=!
2010-04-23 14:53:00
1179
原创 Java sort 源码解析 primitive part
Java Arrays中提供了对所有类型的排序。其中主要分为primitive和Object两大类,分别使用了快速排序与合并排序。本章以int[] 的排序,讲解Java对primitive排序。 首先大家要了解什么是快速排序,它有什么优点,这些我就不累述了,给出地址。http://zh.wikipedia.org/zh/%E5%BF%AB%E9%80%9F%E6%8E%92%E5
2010-04-19 13:14:00
689
2
原创 No9 Java
题目:A Pythagorean triplet is a set of three natural numbers, a b c, for which, a2 + b2 = c2For example, 32 + 42 = 9 + 16 = 25 = 52.Th
2010-04-15 12:28:00
304
原创 No8 Java
题目:Find the greatest product of five consecutive digits in the 1000-digit number.731671765313306249192251196744265747423553491949349698352031277450632623957831801698480186947885184385861
2010-04-15 12:21:00
322
原创 isPrime
用途:判断一个数是否为质数。 代码: public static boolean isPrime(int number) { number = number < 0 ? number * (-1) : number; if (number == 1) { return false; }
2010-04-02 11:24:00
934
原创 No7 Java
题目:By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.What is the 10001st prime number? 翻译:挠齐头陆则质数列撤赖,伺 2,3,5,7,11 高 13。阿
2010-04-02 10:07:00
304
原创 No6 Java
题目:The sum of the squares of the first ten natural numbers is,12 + 22 + ... + 102 = 385The square of the sum of the first ten natural numbers is,(1 + 2 + ... + 10)2
2010-04-02 09:58:00
300
原创 No5 Java
题目:2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.What is the smallest number that is <dfn title="divisible with no remainder">ev
2010-04-01 14:00:00
324
原创 No4 Java
题目:A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.Find the largest palindrome made from the product of t
2010-04-01 12:46:00
312
原创 No3 Java
题目:The prime factors of 13195 are 5, 7, 13 and 29.What is the largest prime factor of the number 600851475143 ? 翻译:13195 的质数因子是 5,7,13 和 29那600851475143 的最大质数因子是几呢? 解题思路:
2010-04-01 12:25:00
335
原创 No2 Java
题目:Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...Find
2010-03-23 12:16:00
356
2
原创 No1 Java
题目: If we list all the natural numbers below 10 that are multiples of 3or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 100
2010-02-26 17:57:00
387
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人