1 2 3 4 5 ··· 23 下一页

2025年11月5日

摘要: 链接:142. 环形链表 II - 力扣(LeetCode) 用哈希表,和环形链表[Python刷题记录]-环形链表-链表-简单 - Annetree - 博客园好像一样的,只是输出的值不一样 1 # Definition for singly-linked list. 2 # class List 阅读全文
posted @ 2025-11-05 15:26 Annetree 阅读(1) 评论(0) 推荐(0)
 
摘要: 链接:141. 环形链表 - 力扣(LeetCode) 可以使用哈希判断是否有相同节点 1 # Definition for singly-linked list. 2 # class ListNode(object): 3 # def __init__(self, x): 4 # self.val 阅读全文
posted @ 2025-11-05 15:20 Annetree 阅读(2) 评论(0) 推荐(0)
 
摘要: 链接:234. 回文链表 - 力扣(LeetCode) 将链表复制到数组中,然后用双指针分别从头尾往中间判断 1 # Definition for singly-linked list. 2 # class ListNode(object): 3 # def __init__(self, val=0 阅读全文
posted @ 2025-11-05 15:11 Annetree 阅读(1) 评论(0) 推荐(0)
 
摘要: 链接:206. 反转链表 - 力扣(LeetCode) 直接写就可以,python主要多一个链表结构的自定义 1 # Definition for singly-linked list. 2 # class ListNode(object): 3 # def __init__(self, val=0 阅读全文
posted @ 2025-11-05 14:38 Annetree 阅读(2) 评论(0) 推荐(0)
 
摘要: 链接:160. 相交链表 - 力扣(LeetCode) 方法一:哈希 把A链表都存入一个哈希表,B链表遍历通过哈希表定位有没有相同的Node,因为哈希表的插入查询都是O(1)。所以这里的时间复杂度就是O(m+n) 1 # Definition for singly-linked list. 2 # 阅读全文
posted @ 2025-11-05 13:34 Annetree 阅读(2) 评论(0) 推荐(0)

2025年11月4日

摘要: 链接:128. 最长连续序列 - 力扣(LeetCode) 先把数组变成哈希 然后以key遍历哈希表,只有每个数字为连续串首位时才进入,即哈希表中不存在key-1,这样才能做到O(N) 1 class Solution(object): 2 def longestConsecutive(self, 阅读全文
posted @ 2025-11-04 17:04 Annetree 阅读(4) 评论(0) 推荐(0)
 
摘要: 链接:49. 字母异位词分组 - 力扣(LeetCode) 使用排序后的字符串作为同组的唯一标识,并作为一个哈希表的key,哈希表的value是原始各字符串 建完哈希表之后打印出结果即可 1 class Solution(object): 2 def groupAnagrams(self, strs 阅读全文
posted @ 2025-11-04 16:45 Annetree 阅读(2) 评论(0) 推荐(0)
 
摘要: 链接:15. 三数之和 - 力扣(LeetCode) 先对数组进行排序 三个数的坐标分别为,i,j,k 为了不重复,假定i<j<k 枚举i,j、k的判断用双指针,j、k分别从i后的头尾出发,向中间靠拢 如果结果=0,就各自往中间移动一位;如果结果>0,说明数字大了,k往前移动一位;如果结果<0,说明 阅读全文
posted @ 2025-11-04 15:31 Annetree 阅读(4) 评论(0) 推荐(0)
 
摘要: 链接:11. 盛最多水的容器 - 力扣(LeetCode) 双指针从头尾开始,每次移动height值更小的一个,头尾向中间移动 1 class Solution(object): 2 def maxArea(self, height): 3 """ 4 :type height: List[int] 阅读全文
posted @ 2025-11-04 14:01 Annetree 阅读(2) 评论(0) 推荐(0)

2025年11月3日

摘要: 链接:283. 移动零 - 力扣(LeetCode) 直接解 1 class Solution(object): 2 def moveZeroes(self, nums): 3 """ 4 :type nums: List[int] 5 :rtype: None Do not return anyt 阅读全文
posted @ 2025-11-03 23:05 Annetree 阅读(3) 评论(0) 推荐(0)

2025年9月2日

摘要: 3. 无重复字符的最长子串 - 力扣(LeetCode) 1 class Solution(object): 2 def lengthOfLongestSubstring(self, s): 3 """ 4 :type s: str 5 :rtype: int 6 """ 7 length = le 阅读全文
posted @ 2025-09-02 15:24 Annetree 阅读(10) 评论(0) 推荐(0)
 
摘要: 1. 两数之和 - 力扣(LeetCode) 第一次提交 1 class Solution(object): 2 def twoSum(self, nums, target): 3 """ 4 :type nums: List[int] 5 :type target: int 6 :rtype: L 阅读全文
posted @ 2025-09-02 11:37 Annetree 阅读(7) 评论(0) 推荐(0)
 
摘要: 一 python 写循环 在Python中,有多种方式可以实现循环。最常用的循环结构包括for循环和while循环。下面是一些基本的例子: 1. 使用for循环 for循环通常用于遍历一个序列(如列表、元组、字符串或范围)中的元素。 遍历列表 fruits = ['apple', 'banana', 阅读全文
posted @ 2025-09-02 11:18 Annetree 阅读(10) 评论(0) 推荐(0)

2020年9月9日

摘要: 自动化测试也有非常多的种类, 对Web UI 的自动化测试程序 对Windows 窗体UI的自动化测试程序 API测试, 比如(测试WCF service, Web API 等) 数据库测试, 比如测试存储过程 接口测试 (这种只能用自动化测) 单元测试 性能测试, 性能测试都需要用到自动化 htt 阅读全文
posted @ 2020-09-09 08:50 Annetree 阅读(141) 评论(0) 推荐(0)

2020年9月8日

摘要: https://www.cnblogs.com/yanshw/p/10852860.html selenium的原理 Selenium 1 实现原理 Selenium 引入了 Remote Control Server 这样一个代理 Server, 脚本注入和与 Server 通讯都通过这个代理 S 阅读全文
posted @ 2020-09-08 22:49 Annetree 阅读(216) 评论(0) 推荐(0)
1 2 3 4 5 ··· 23 下一页