方法一: 哈希表 时间复杂度:O(n) 空间复杂度:O(n) class Solution: def hasCycle(self, head: ListNode) -> bool: dict = {} while head: if head in dict: return True else: di ...
分类:
其他好文 时间:
2020-06-25 09:26:14
阅读次数:
60
基本使用 import unittestclass Testcase(unittest.TestCase): @classmethod def setUpClass(cls): pass @classmethod def tearDownClass(cls): pass def setUp(self ...
分类:
编程语言 时间:
2020-06-25 09:21:11
阅读次数:
104
二叉树广度优先遍历:一层一层 二叉树深度优先遍历:前序(根左右)、中序(左根右)、后序(左右根) class Node(): def __init__(self, item): self.item = item self.left = None self.right = None class Tre ...
分类:
其他好文 时间:
2020-06-24 23:53:15
阅读次数:
105
You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1' ...
分类:
其他好文 时间:
2020-06-24 23:43:31
阅读次数:
50
1- DATEDIFF(date1,date2) 函数返回两个日期之间的天数。 date1 和 date2 参数是合法的日期或日期/时间表达式。 注释:只有值的日期部分参与计算。 SELECT DATEDIFF('2008-12-29','2008-12-28') AS DiffDate 结果:1 ...
分类:
数据库 时间:
2020-06-24 21:25:54
阅读次数:
71
使用httprunner3.x版本 python版本是3.6 测试环境是zen dao 以下为脚本: # NOTE: Generated By HttpRunner v3.1.0 # FROM: assign_me.har import re from httprunner import HttpR ...
分类:
Web程序 时间:
2020-06-24 19:33:41
阅读次数:
54
今天早上系统突然挂掉,查看数据库发现数据库内存使用完了,然后看trace日志发现: os thread scheduling delay history: (sampling every 1.000000 secs) 0.000000 secs at [ 08:58:05 ] NOTE: sched ...
分类:
系统相关 时间:
2020-06-24 19:29:27
阅读次数:
122
1 def _parse_known_args(self, arg_strings, namespace): 2 # replace arg strings that are file references 3 if self.fromfile_prefix_chars is not None: 4 ...
分类:
其他好文 时间:
2020-06-24 14:04:54
阅读次数:
54
Self-supervised Video Object Segmentation 2020-06-24 12:50:31 Paper: https://arxiv.org/abs/2006.12480 Code: https://github.com/fangruizhu/self_sup_sem ...
分类:
其他好文 时间:
2020-06-24 13:41:33
阅读次数:
58
中序遍历排序 思路: ①按中序遍历树 ②确定交换的元素x,y ③再次遍历树,改变对应节点的值 代码: # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right ...
分类:
其他好文 时间:
2020-06-24 12:15:25
阅读次数:
53