![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构算法
followUrheart6
这个作者很懒,什么都没留下…
展开
-
LeetCode 刷题之路08 Strings
字符串切分 .split, .replace()"""https://leetcode.com/tag/string/"""import refrom typing import Listclass Solution: # 1108. Defanging an IP Address def defangIPaddr(self, address: str) ->...原创 2020-04-16 15:47:32 · 130 阅读 · 0 评论 -
python 图 DFS, BFS 遍历
图DFS BFS 遍历# define a graphfrom collections import dequen = ['A','B','C','D','E','F']graph={ 'A':['B','C'], 'B':['A','C','D'], 'C':['A','B','E'], 'D':['B','E','F'], 'E':['C'...原创 2020-04-12 14:06:59 · 176 阅读 · 0 评论 -
python 链表发方细致实现配例子
看了数据结构关于链表的内容,于是在leetcode上搜索了对用题目,同时动手实现了链表的数据结构。最后一种使用list 方式实在是太有python风格了。代码都有对应注释。# Node for Linked List https://leetcode.com/problems/design-linked-list/class Node: def __init__(self, data...原创 2020-04-11 23:23:00 · 268 阅读 · 0 评论