The smallest number expressible as the sum of a prime square, prime cube, and prime fourth power is 28. In fact, there are exactly four numbers below fifty that can be expressed
in such a way:
28...
分类:
其他好文 时间:
2015-07-23 21:50:50
阅读次数:
210
Given a binary search tree, write a functionkthSmallestto find thekth smallest element in it.Note:You may assume k is always valid, 1 ≤ k ≤ BST's tota...
分类:
其他好文 时间:
2015-07-23 13:47:56
阅读次数:
90
Given a binary search tree, write a function kthSmallest to find the kth
smallest element in it.
Note:
You may assume k is always valid, 1 ≤ k ≤ BST's total elements.
直观地一想,查找第k小的数,不就是...
分类:
其他好文 时间:
2015-07-22 16:22:04
阅读次数:
87
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note: You may assume k is always valid, 1 ≤ k ≤ BST's total elements.Follow up:What if the BST is modifi...
分类:
其他好文 时间:
2015-07-19 16:32:18
阅读次数:
137
You have a positive integermand a non-negative integers. Your task is to find the smallest and the largest of the numbers that have lengthmand sum of ...
分类:
其他好文 时间:
2015-07-16 21:59:17
阅读次数:
144
Given a binary search tree, write a functionkthSmallestto find thekth smallest element in it.Note:You may assume k is always valid, 1 ≤ k ≤ BST's tota...
分类:
其他好文 时间:
2015-07-15 18:33:34
阅读次数:
80
You are givennk-digit integers. You have to rearrange the digits in the integers so that the difference between the largest and the smallest number wa...
分类:
其他好文 时间:
2015-07-15 01:17:15
阅读次数:
244
The cube, 41063625 (3453), can be permuted to produce two other cubes: 56623104 (3843) and 66430125 (4053). In fact, 41063625 is the smallest cube
which has exactly three permutations of its digits ...
分类:
其他好文 时间:
2015-07-14 18:21:53
阅读次数:
113
题目:Given a binary search tree, write a functionkthSmallestto find thekth smallest element in it.Note:You may assume k is always valid, 1 ≤ k ≤ BST's t...
分类:
其他好文 时间:
2015-07-14 15:13:55
阅读次数:
98
class Solution {public: int kthSmallest(TreeNode* root, int k) { int num = 0; TreeNode*pNode=NULL; visit(root, k, num, pNode);...
分类:
其他好文 时间:
2015-07-14 15:01:24
阅读次数:
82