一、题目 1、审题 2、分析 实现一个数据结构,可以添加整形元素,并可以返回排序后的中位数。 二、解答 1、思路 采用两个 PriorityQueue。 ①、采用两个 PriorityQueue,PriorityQueue 具有对元素进行自动排序的功能。 ②、一个为 maxQueue,记录比中位数大 ...
分类:
其他好文 时间:
2018-11-25 18:00:58
阅读次数:
167
Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes. Example: Note: There are at ...
分类:
编程语言 时间:
2018-11-25 17:47:34
阅读次数:
163
https://leetcode.com/problems/combinations/ Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. Example: 代码: 看 F ...
分类:
其他好文 时间:
2018-11-25 17:43:23
阅读次数:
142
该题目是leetcode上一道非常简单但是经典的题,现把该题的较为经典的解题思路进行总结 1 题目描述 该题的输入是给定一个数组,以及一个目标值,通过计算找出数组中两个元素和等于目标值的各自的索引。 如下例子所示: Given nums = [2, 7, 11, 15], target = 9, B ...
分类:
其他好文 时间:
2018-11-25 13:09:53
阅读次数:
150
import os def two_abs_join(abs1, abs2): """ 将 绝对路径将两个绝对路径拼接, 就是将第二个的开路径(windows 的 C, D,E ... Linux 的 /root 最前面的 / 删除掉) :param abs1: 为主的路径 :param abs2:... ...
分类:
编程语言 时间:
2018-11-24 23:59:20
阅读次数:
527
Given a Binary Search Tree (BST) with the root node root, return the minimum difference between the values of any two different nodes in the tree. Exa ...
分类:
编程语言 时间:
2018-11-24 11:48:30
阅读次数:
190
https://leetcode.com/problems/multiply-strings/ Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and n ...
分类:
其他好文 时间:
2018-11-23 20:43:27
阅读次数:
168
无标题文档 one two three 广告 目前正在学习css定位.... 目前正在学习css定位.... 目前正在学习css定位.... 目前正在学习css定位.... 目前正在学习css定位.... 目前正在学习css定位.... 目前正在学习css定位.... 目前正在学习css定位....... ...
分类:
Web程序 时间:
2018-11-23 10:15:44
阅读次数:
241
pd.concat([df1, df2], axis=1) df.sort_index(inplace=True)https://stackoverflow.com/questions/40468069/merge-two-dataframes-by-indexhttps://stackoverfl ...
分类:
编程语言 时间:
2018-11-22 14:39:27
阅读次数:
264
四、特征缩放1.特征缩放的优点:Andrew在他的机器学习课程里强调,在进行学习之前要进行特征缩放,目的是保证这些特征都具有相近的尺度,这将帮助梯度下降算法更快地收敛。python里常用的是preprocessing.StandardScaler(),公式为:(X-mean)/std,得到的结果是, ...
分类:
其他好文 时间:
2018-11-22 14:39:01
阅读次数:
196