logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

[leetcode] 426. Convert Binary Search Tree to Sorted Doubly Linked List @ python

原题https://leetcode.com/problems/convert-binary-search-tree-to-sorted-doubly-linked-list/解法使用递归, base case是如果node为空, 返回None. 定义helper函数, 使用头结点和尾节点, 将子树的头结点和尾节点与母树相连.Time: O(v), v是二叉树的节点数目Space: O(...

[leetcode] 48. Rotate Image @ python

原题You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Note:You have to rotate the image in-place, which means you have to modify the input 2D matrix d...

[leetcode] 621. Task Scheduler @ python

原题Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different tasks. Tasks could be done without original order. Each task cou.

[leetcode] 38. Count and Say @ python

原题The count-and-say sequence is the sequence of integers with the first five terms as following:1112112111112211 is read off as “one 1” or 11.11 is read off as “two 1s” or 21....

[leetcode] 160. Intersection of Two Linked Lists @ python

原题https://leetcode.com/problems/intersection-of-two-linked-lists/解法链表A和链表B的长度可能不相等, 所以我们需要将较长的链表多出的节点忽略掉. 定义getLength函数计算链表的长度, 然后将较长的链表的head移动n次, n为多出的长度. 然后同时遍历链表A和链表B, 当headA == headB时, 返回节点. 这里...

[leetcode] 67. Add Binary @ python

原题Given two binary strings, return their sum (also a binary string).The input strings are both non-empty and contains only characters 1 or 0.Example 1:Input: a = “11”, b = “1”Output: “100”Exampl...

[leetcode] 78. Subsets @ python

原题Given a set of distinct integers, nums, return all possible subsets (the power set).Note: The solution set must not contain duplicate subsets.Example:Input: nums = [1,2,3]Output:[[3],[1],[2...

python爬虫: 爬取拉勾网职位并分析

0. 前言1. 用到的软件包2. 解析网页3. 数据清洗4. 词云5. 描述统计6. 实证统计7. 完整代码0. 前言本文从拉勾网爬取深圳市数据分析的职位信息,并以CSV格式保存至电脑, 之后进行数据清洗, 生成词云,进行描述统计和回归分析,最终得出结论.1. 用到的软件包Python版本: Python3.6requests: 下载网...

#python#爬虫#数据分析
python爬虫入门:豆瓣电影Top250抓取

【前言】本文从豆瓣网爬取前250部电影,并以CSV格式下载至电脑。本人才疏学浅,如有不足之处,还请各位大神指正。【用到的软件包和知识点】requests:下载网页BeautifulSoup4:解析网页,提取所需数据 re:匹配正则表达式pandas:将数据转化为data frame, 再输出为csv格式【思路】采用divide-and-conquer方法,先对一个网页进行分析和抓取,再用循环,应用

#python#爬虫
11. 盛最多水的容器 @Python @Go

【代码】11. 盛最多水的容器 @Python @Go。

#python#算法
    共 15 条
  • 1
  • 2
  • 请选择