- 博客(10)
- 收藏
- 关注
原创 python中的字典合并的四种方法举例
Python中的字典合并的四种方式以及value值是string类型时的字典合并一. 普通的合并dict1 = {'a':1,'b':2,'c':3}dict2 = {'d':8,'e':7,'g':6}合并得到:{'a': 1, 'c': 3, 'b': 2, 'e': 7, 'd': 8, 'g': 6}1.方法1 dict1.items()+dict2.items(...
2019-06-11 15:49:07
9192
1
原创 LeetCode解题之100. Same Tree
题目描述:100.Same TreeGiven two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally identical and the nodes have th...
2019-04-26 16:17:49
183
原创 LeetCode解题之104. Maximum Depth of Binary Tree(Java)
题目描述:104. Maximum Depth of Binary TreeGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf nod...
2019-04-26 15:58:21
206
原创 LeetCode解题之101.Symmetric Tree(Java)
题目描述:101.Symmetric TreeGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree[1,2,2,3,4,4,3]is symmetric: 1 / \ ...
2019-04-26 14:34:51
233
1
原创 LeetCode解题之102.Binary Tree Level Order Traversal(Java)
题目描述:102.Binary Tree Level Order TraversalGiven a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree[3,...
2019-04-26 11:19:16
220
1
原创 【先更!!】爬虫之动态网站~~爬图片辣(也是我的第二个python爬虫emmmm
一. 简介 (爬虫,爬虫,就是一只在“爬”的虫hh,网络爬虫,也被称为网络蜘蛛,它能根据网页的url爬取网页的内容。) 问:什么是网络爬虫 答:一段程序(一个脚本) 问:爬虫能干什么 答:能够模拟浏览器自动的浏览网页,自动的、批量的采集我们需要的资源(图片、视频、文件等) 如果现在我想要下...
2018-11-23 14:25:03
589
原创 机器学习之随笔
1. len(matrix)与len(matrix[0])的区别 如下图所示: len(matrix)是行 len(matrix[0])是列2. lambda函数和reduce函数 1)lambda函数:lambda函数是匿名的:所谓匿名函数,通俗地说就是没有名字的函数。lambda函数没有名字一些lamb...
2018-10-17 16:13:44
1149
原创 机器学习:性能度量指标之查准率和查全率
在很多实际应用中,我们知道仅仅关心正确分类的结果是不够的,并且,在数据偏斜比较严重的情况下,模型准确率可能具有相当程度的误导性,我们也需要知道数据被错误分类的情况,以确认为此需要承担的分类错误的代价。(False Positive假阳性和False Negative假阴性,这两种情况)查准率(Precision精度):用于描述所有被正确分类的样本中真阳性的比值。查全率(Recall...
2018-09-11 20:25:33
1536
原创 LeetCode经典算法题之Factorial Trailing Zeroes
LeetCode(172) Factorial Trailing Zeroes题目描述:Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.即:给定一个数,求其阶乘的结果的尾部0的个数。...
2018-09-06 15:57:01
168
原创 LeetCode算法题之一
LeetCode算法题之一 题目描述:Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.If the fractional part is repeating, enclose the repeating p...
2018-09-05 19:09:37
257
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人