码迷,mamicode.com
首页 >  
搜索关键字:smallest difference    ( 1670个结果
230. Kth Smallest Element in a BST
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. 找二叉搜索树中第k个小的值。 用中序遍历,增加一个全局变量记录访问到第几个节点,返回访问的第k个节点的值。 ...
分类:其他好文   时间:2017-12-20 03:51:14    阅读次数:132
LeetCode 744. Find Smallest Letter Greater Than Target (时间复杂度O(n))
题目 太简单了,直接上代码: ...
分类:其他好文   时间:2017-12-18 01:12:53    阅读次数:103
find second maximum element in Binary search tree
一个BST, 问怎么找到第二大的节点。首先说了个naive的方法,serialize, 他问有没有更有效的方法。最后用的iterative的方法向右遍历子节点 log(n) 或者inorder, O(n): 230. Kth Smallest Element in a BST ...
分类:其他好文   时间:2017-12-14 03:46:57    阅读次数:113
1036. Boys vs Girls (25)
This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students. Inp ...
分类:其他好文   时间:2017-12-12 23:56:39    阅读次数:310
[LeetCode] Find Smallest Letter Greater Than Target
Given a list of sorted characters letters containing only lowercase letters, and given a target letter target, find the smallest element in the list t ...
分类:其他好文   时间:2017-12-12 15:16:44    阅读次数:152
744. Find Smallest Letter Greater Than Target 找到大于目标的最小的字母
Given a list of sorted characters letters containing only lowercase letters, and given a target letter target, find the smallest element in the list t... ...
分类:其他好文   时间:2017-12-12 00:20:22    阅读次数:190
python文本处理练习-3
"计算数组中最小的两个数的和" #!usr/bin/python3 #-*- coding:utf-8 -*- numbers=np.array((4,3,7,5,6)) def sum_two_smallest_numbers(numbers): numbers.sort() return num... ...
分类:编程语言   时间:2017-12-11 16:14:42    阅读次数:123
the 5th element from the tail
not one pass: 1)Take 2 pointer move one pointer by 5 position ie, the difference between the two pointer is 5. 2)Now traverse through the list till th ...
分类:其他好文   时间:2017-12-10 11:15:15    阅读次数:186
[Python] Understand Mutable vs. Immutable objects in Python
In this lesson, you will learn what mutable and immutable objects are, and the difference between them. This understanding will help you determine whe ...
分类:编程语言   时间:2017-12-09 19:32:54    阅读次数:134
Nodejs Guides(二)
page3.Overview of Blocking vs Non-Blocking This overview covers the difference between blocking and non-blocking calls in Node.js. This overview will ...
分类:Web程序   时间:2017-12-08 23:57:18    阅读次数:276
1670条   上一页 1 ... 49 50 51 52 53 ... 167 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!