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

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 阅读(2) 评论(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)

2020年9月7日

摘要: 1. 什么是线程池? 顾名思义,存放线程的一个池子。 2.怎么设计一个线程池 (1) 新建一个数组,创建一堆线程存放进去; (2) 线程池中的线程来处理任务,处理完成后回收线程而不是销毁线程; (3) 设计等待队列来存放来不及处理的任务; (4) 拒绝策略 一般一个简单线程池至少包含下列组成部分。 阅读全文
posted @ 2020-09-07 13:31 Annetree 阅读(104) 评论(0) 推荐(0)
 
摘要: 多态 在面向对象语言中,接口的多种不同的实现方式即为多态。同一操作作用于不同的对象,可以有不同的解释,产生不同的执行结果。在运行时,可以通过指向基类的指针,来调用实现派生类中的方法。C++中,实现多态有以下方法:虚函数,抽象类,覆盖,模板(重载和多态无关)。多态就是允许方法重名 参数或返回值可以是父 阅读全文
posted @ 2020-09-07 12:33 Annetree 阅读(134) 评论(0) 推荐(0)

2020年9月4日

摘要: 解决方案: File-settings 选择对应的project和要用的环境,选+号 安装速度慢选择镜像 Options :--trusted-host mirrors.aliyun.com 详见 https://blog.csdn.net/zw05011/article/details/94001 阅读全文
posted @ 2020-09-04 09:46 Annetree 阅读(533) 评论(0) 推荐(0)

2020年9月3日

摘要: 求最大公约数 1 #include<cstdio> 2 #include<iostream> 3 #include<algorithm> 4 using namespace std; 5 //枚举法 6 void find1(int a,int b) 7 { 8 int i = min(a, b); 阅读全文
posted @ 2020-09-03 16:59 Annetree 阅读(272) 评论(0) 推荐(0)

2020年9月2日

摘要: 解决方案1:使用TimeZone 解决方案2:使用setProperty System.setProperty(“user.timezone”,”Asia/Shanghai”); 来源 https://blog.csdn.net/callmev6/article/details/80989647 阅读全文
posted @ 2020-09-02 10:53 Annetree 阅读(193) 评论(0) 推荐(0)
1 2 3 4 5 ··· 22 下一页