上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 14 下一页
摘要: #2019.7.11: (这个问题也解决了如何复制一个单向链表) 我的思路: 创建一个新的链表,a、b指针分别指向两个链表,谁小就把那个节点的val给新的节点然后加到新的链表中,最后返回 我的代码: 阅读全文
posted @ 2019-07-11 23:40 Marvin_Tang 阅读(123) 评论(0) 推荐(0) 编辑
摘要: #2019.5.23: leetcode_1: #844 Given two strings S and T, return if they are equal when both are typed into empty text editors. # means a backspace char 阅读全文
posted @ 2019-07-11 19:08 Marvin_Tang 阅读(130) 评论(0) 推荐(0) 编辑
摘要: #2019.5.24: leetcode_2: #306(未解决)很沮丧,今天这个问题没能解决出来,部分网友说回溯法能做,这个高级的算法还没学,之后补充 题目:累加数 Additive number is a string whose digits can form additive sequenc 阅读全文
posted @ 2019-07-11 19:01 Marvin_Tang 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 2019.5.25: #1 Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input 阅读全文
posted @ 2019-07-11 18:36 Marvin_Tang 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Given linked list -- head = [4,5,1,9], wh 阅读全文
posted @ 2019-07-11 18:13 Marvin_Tang 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 原文:https://zhuanlan.zhihu.com/p/36173202 单前导下划线:_var 单末尾下划线:var_ 双前导下划线:__var 双前导和末尾下划线:__var__ 单下划线:_ 1. 单前导下划线 _var 下划线前缀的含义是告知其他程序员:以单个下划线开头的变量或方法仅 阅读全文
posted @ 2019-07-09 13:52 Marvin_Tang 阅读(2345) 评论(0) 推荐(1) 编辑
摘要: Python的魔术方法一般以__methodname__的形式命名,如:__init__(构造方法), __getitem__、 __setitem__(subscriptable所需method), __delitem__(del obj[key]所需method), __len__(len(…) 阅读全文
posted @ 2019-07-09 12:14 Marvin_Tang 阅读(545) 评论(0) 推荐(0) 编辑
摘要: 关于本地存放的映射关系map: 本质上是一个空字典:self.map={} 每次新增一个节点node,都会把node的key, value放入map中: self.map[key] = node ==> self.map的样子应该是{key1:node1, key2:node2} (注意:node是 阅读全文
posted @ 2019-07-03 16:33 Marvin_Tang 阅读(977) 评论(0) 推荐(0) 编辑
摘要: 双向链表: 设计想法: 实现链表节点:可以存放Key-Value数据 实现双向链表:往头部增加节点、往尾部增加节点、删除任意节点、弹出尾部节点、弹出头部节点 代码实现: 测试结果: {0: 0}{0: 0}=>{1: 1}{1: 1}{1: 1}=>{2: 2}{3: 3}=>{1: 1}=>{2: 阅读全文
posted @ 2019-07-03 11:59 Marvin_Tang 阅读(481) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 14 下一页