码迷,mamicode.com
首页 >  
搜索关键字:smallest    ( 560个结果
POJ 2718 (Smallest Different)
题目链接:http://poj.org/problem?id=2718 题意: 将所给出的所有数字排列组合生成两个数,使其差的绝对值最小。求最小值。 这是一道穷竭搜索类型的题目,难度不大,还学到了 next_permutation 函数, 写好了一个代码后提交却是TLE!太搞人心态了,修改后有时报错 ...
分类:其他好文   时间:2020-03-22 19:33:31    阅读次数:75
[LeetCode] 230. Kth Smallest Element in a BST
二叉搜索树中第K小的元素。题目即是题意。例子, Example 1: Input: root = [3,1,4,null,2], k = 1 3 / \ 1 4 \ 2 Output: 1 Example 2: Input: root = [5,3,6,2,4,null,null,1], k = 3 ...
分类:其他好文   时间:2020-03-20 09:21:35    阅读次数:64
230. Kth Smallest Element in a BST
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 ...
分类:其他好文   时间:2020-03-12 10:13:11    阅读次数:82
[LeetCode] 632. Smallest Range Covering Elements from K Lists
[LeetCode]632. Smallest Range Covering Elements from K Lists 你有 k 个升序排列的整数数组。找到一个最小区间,使得 k 个列表中的每个列表至少有一个数包含在其中。 我们定义如果 b-a < d-c 或者在 b-a == d-c 时 a < ...
分类:其他好文   时间:2020-03-06 23:40:33    阅读次数:69
[LC] 373. Find K Pairs with Smallest Sums
You are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k. Define a pair (u,v) which consists of one element from th ...
分类:其他好文   时间:2020-02-13 13:22:48    阅读次数:67
POJ1094 Sorting It All Out
An ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to large ...
分类:其他好文   时间:2020-02-12 18:29:23    阅读次数:62
865. Smallest Subtree with all the Deepest Nodes
Given a binary tree rooted at root, the depth of each node is the shortest distance to the root. A node is deepest if it has the largest depth possibl ...
分类:其他好文   时间:2020-02-06 11:07:31    阅读次数:74
[Leetcode]668.Kth Smallest Number in Multiplication Table
链接: "LeetCode668" 给定高度m?、宽度n 的一张?m n的乘法表,以及正整数k,你需要返回表中第k?小的数字。 例?1: 输入: m = 3, n = 3, k = 5 输出: 3 解释: 乘法表: 1 2 3 2 4 6 3 6 9 第5小的数字是 3 (1, 2, 2, 3, 3 ...
分类:其他好文   时间:2020-02-03 12:00:25    阅读次数:61
PAT Advanced 1038 Recover the Smallest Number (30) [贪?算法]
PAT 甲级 Advanced 1038 Recover the Smallest Number (30) [贪?算法] ...
分类:编程语言   时间:2020-01-30 22:58:04    阅读次数:95
最短路径 floyd/dijkstra-Find the City With the Smallest Number of Neighbors at a Threshold Distance
2020-01-30 22:22:58 ...
分类:其他好文   时间:2020-01-30 22:44:10    阅读次数:73
560条   上一页 1 2 3 4 5 6 ... 56 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!