随笔分类 -  剑指offer

摘要:1 # -*- coding:utf-8 -*- 2 """用row和col两参数逐行或逐列遍历数组""" 3 class Solution: 4 # array 二维列表 5 def Find(self, target, array): 6 # write code here 7 rows = l 阅读全文
posted @ 2019-05-08 17:31 Parallax 阅读(105) 评论(0) 推荐(0) 编辑
摘要:1 # -*- coding:utf-8 -*- 2 # class ListNode: 3 # def __init__(self, x): 4 # self.val = x 5 # self.next = None 6 """没有三个指针解决不了的问题""" 7 class Solution: 阅读全文
posted @ 2019-05-08 02:18 Parallax 阅读(151) 评论(0) 推荐(0) 编辑
摘要:1 # -*- coding:utf-8 -*- 2 # class ListNode: 3 # def __init__(self, x): 4 # self.val = x 5 # self.next = None 6 class Solution: 7 def EntryNodeOfLoop( 阅读全文
posted @ 2019-05-07 21:37 Parallax 阅读(82) 评论(0) 推荐(0) 编辑
摘要:1 # -*- coding:utf-8 -*- 2 # class ListNode: 3 # def __init__(self, x): 4 # self.val = x 5 # self.next = None 6 """首先判断长度,然后移动指针将两个链表尾部对齐,当两链表的头指针相等时, 阅读全文
posted @ 2019-05-07 19:57 Parallax 阅读(142) 评论(0) 推荐(0) 编辑
摘要:1 # -*- coding:utf-8 -*- 2 # class ListNode: 3 # def __init__(self, x): 4 # self.val = x 5 # self.next = None 6 class Solution: 7 # 返回合并后列表 8 def Merg 阅读全文
posted @ 2019-05-07 05:09 Parallax 阅读(89) 评论(0) 推荐(0) 编辑
摘要:1 # -*- coding:utf-8 -*- 2 # class ListNode: 3 # def __init__(self, x): 4 # self.val = x 5 # self.next = None 6 """pHead指针通过其.next属性将原链表上next_指针前移,pre 阅读全文
posted @ 2019-05-07 02:35 Parallax 阅读(80) 评论(0) 推荐(0) 编辑
摘要:1 # -*- coding:utf-8 -*- 2 # class ListNode: 3 # def __init__(self, x): 4 # self.val = x 5 # self.next = None 6 7 """双指针的关键是如何保持指针的距离为k-1""" 8 class S 阅读全文
posted @ 2019-05-06 18:34 Parallax 阅读(85) 评论(0) 推荐(0) 编辑
摘要:1 # -*- coding:utf-8 -*- 2 # class ListNode: #指的是每一个点的数值 3 # def __init__(self, x): 4 # self.val = x 5 # self.next = None 6 7 class Solution: 8 # 返回从尾 阅读全文
posted @ 2019-04-23 18:58 Parallax 阅读(82) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示