2016年1月4日
摘要:
题目带重复元素的排列给出一个具有重复数字的列表,找出列表所有不同的排列。样例给出列表[1,2,2],不同的排列有:[ [1,2,2], [2,1,2], [2,2,1]]挑战使用递归和非递归分别完成该题。解题和上面差不多,增加判断res中是否已经存在该排列的语句,这种方法不是很好,但是竟然也... 阅读全文
posted @ 2016-01-04 16:30
水滴四川
阅读(501)
推荐(0)
编辑
摘要:
题目全排列给定一个数字列表,返回其所有可能的排列。您在真实的面试中是否遇到过这个题?Yes样例给出一个列表[1,2,3],其全排列为:[ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]]挑战使用递归和非递归分别解决。解题深度优先遍... 阅读全文
posted @ 2016-01-04 15:35
水滴四川
阅读(767)
推荐(0)
编辑
摘要:
题目带最小值操作的栈 实现一个带有取最小值min方法的栈,min方法将返回当前栈中的最小值。你实现的栈将支持push,pop和min操作,所有操作要求都在O(1)时间内完成。解题可以定义一个数组或者其他的存储最小值,第i个元素,表示栈中前i个元素的最小值。定义两个ArrayList来存储栈,一个Ar... 阅读全文
posted @ 2016-01-04 11:32
水滴四川
阅读(1220)
推荐(0)
编辑
摘要:
题目 给定两个值 k1 和 k2(k1 < k2)和一个二叉查找树的根节点。找到树中所有值在 k1 到 k2 范围内的节点。即打印所有x (k1 <= x <= k2) 其中 x 是二叉查找树的中的节点值。返回所有升序的节点值。 如果有 k1 = 10 和 k2 = 22, 你的程序应该返回 [12 阅读全文
posted @ 2016-01-04 10:13
水滴四川
阅读(1281)
推荐(0)
编辑
2016年1月3日
摘要:
题目第k大元素在数组中找到第k大的元素样例给出数组[9,3,2,4,8],第三大的元素是4给出数组[1,2,3,4,5],第一大的元素是5,第二大的元素是4,第三大的元素是3,以此类推注意你可以交换数组中的元素的位置挑战要求时间复杂度为O(n),空间复杂度为O(1)解题理论快速排序的思想,每次都减半... 阅读全文
posted @ 2016-01-03 22:09
水滴四川
阅读(1993)
推荐(0)
编辑
摘要:
什么是json:JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式。易于人阅读和编写。同时也易于机器解析和生成。它基于JavaScript Programming Language, Standard ECMA-262 3rd Edition - Decem... 阅读全文
posted @ 2016-01-03 19:47
水滴四川
阅读(367)
推荐(0)
编辑
2015年12月7日
摘要:
Arranged probabilityIf a box contains twenty-one coloured discs, composed of fifteen blue discs and six red discs, and two discs were taken at random,... 阅读全文
posted @ 2015-12-07 22:39
水滴四川
阅读(705)
推荐(0)
编辑
摘要:
Largest exponential Comparing two numbers written in index form like 211 and 37 is not difficult, as any calculator would confirm that 211 = 2048 < 37 阅读全文
posted @ 2015-12-07 22:11
水滴四川
阅读(565)
推荐(0)
编辑
摘要:
Anagramic squaresBy replacing each of the letters in the word CARE with 1, 2, 9, and 6 respectively, we form a square number: 1296 = 362. What is rema... 阅读全文
posted @ 2015-12-07 21:25
水滴四川
阅读(838)
推荐(0)
编辑
2015年12月6日
摘要:
Large non-Mersenne primeThe first known prime found to exceed one million digits was discovered in 1999, and is a Mersenne prime of the form 26972593−... 阅读全文
posted @ 2015-12-06 20:21
水滴四川
阅读(646)
推荐(0)
编辑
摘要:
Su DokuSu Doku (Japanese meaningnumber place) is the name given to a popular puzzle concept. Its origin is unclear, but credit must be attributed to L... 阅读全文
posted @ 2015-12-06 19:28
水滴四川
阅读(988)
推荐(0)
编辑
2015年12月5日
摘要:
Amicable chainsThe proper divisors of a number are all the divisors excluding the number itself. For example, the proper divisors of 28 are 1, 2, 4, 7... 阅读全文
posted @ 2015-12-05 19:17
水滴四川
阅读(758)
推荐(0)
编辑
2015年12月4日
摘要:
Almost equilateral trianglesIt is easily proved that no equilateral triangle exists with integral length sides and integral area. However, thealmost e... 阅读全文
posted @ 2015-12-04 22:31
水滴四川
阅读(792)
推荐(0)
编辑
2015年12月3日
摘要:
Arithmetic expressionsBy using each of the digits from the set, {1, 2, 3, 4}, exactly once, and making use of the four arithmetic operations (+, −, *,... 阅读全文
posted @ 2015-12-03 17:25
水滴四川
阅读(734)
推荐(0)
编辑
2015年12月1日
摘要:
题目Square digit chainsA number chain is created by continuously adding the square of the digits in a number to form a new number until it has been seen... 阅读全文
posted @ 2015-12-01 16:58
水滴四川
阅读(783)
推荐(0)
编辑
2015年11月30日
摘要:
Right triangles with integer coordinatesThe points P (x1, y1) and Q (x2, y2) are plotted at integer co-ordinates and are joined to the origin, O(0,0),... 阅读全文
posted @ 2015-11-30 21:19
水滴四川
阅读(555)
推荐(0)
编辑
2015年11月29日
摘要:
Cube digit pairsEach of the six faces on a cube has a different digit (0 to 9) written on it; the same is done to a second cube. By placing the two cu... 阅读全文
posted @ 2015-11-29 20:03
水滴四川
阅读(520)
推荐(0)
编辑
摘要:
Roman numeralsFor a number written in Roman numerals to be considered valid there are basic rules which must be followed. Even though the rules allow ... 阅读全文
posted @ 2015-11-29 17:17
水滴四川
阅读(937)
推荐(0)
编辑
摘要:
Product-sum numbersA natural number, N, that can be written as the sum and product of a given set of at least two natural numbers, {a1, a2, … , ak} is... 阅读全文
posted @ 2015-11-29 16:31
水滴四川
阅读(858)
推荐(0)
编辑
2015年11月27日
摘要:
Prime power triplesThe smallest number expressible as the sum of a prime square, prime cube, and prime fourth power is 28. In fact, there are exactly ... 阅读全文
posted @ 2015-11-27 20:39
水滴四川
阅读(831)
推荐(1)
编辑
摘要:
Cuboid routeA spider, S, sits in one corner of a cuboid room, measuring 6 by 5 by 3, and a fly, F, sits in the opposite corner. By travelling on the s... 阅读全文
posted @ 2015-11-27 18:42
水滴四川
阅读(530)
推荐(0)
编辑
2015年11月26日
摘要:
Counting rectanglesBy counting carefully it can be seen that a rectangular grid measuring 3 by 2 contains eighteen rectangles:Although there exists no... 阅读全文
posted @ 2015-11-26 21:23
水滴四川
阅读(482)
推荐(0)
编辑
摘要:
Monopoly oddsIn the game,Monopoly, the standard board is set up in the following way:GOA1CC1A2T1R1B1CH1B2B3JAILH2C1T2U1H1C2CH3C3R4R2G3D1CC3CC2G2D2G1D3... 阅读全文
posted @ 2015-11-26 20:22
水滴四川
阅读(1019)
推荐(0)
编辑
2015年11月23日
摘要:
Path sum: four waysNOTE: This problem is a significantly more challenging version ofProblem 81.In the 5 by 5 matrix below, the minimal path sum from t... 阅读全文
posted @ 2015-11-23 21:54
水滴四川
阅读(686)
推荐(0)
编辑
摘要:
Path sum: three waysNOTE: This problem is a more challenging version ofProblem 81.The minimal path sum in the 5 by 5 matrix below, by starting in any ... 阅读全文
posted @ 2015-11-23 19:53
水滴四川
阅读(723)
推荐(0)
编辑
|
|
|