- 博客(7)
- 收藏
- 关注
原创 c++ 面试常见的排序
title: 面试常见的排序date: 2022-05-05 12:39:54tags: [排序]categories: [算法,面试]我的博客一、快速排序 快速排序平均时间复杂度为o(nlogn),最坏时间复杂度为o(n^2),不稳定; 主要可以通过以下几种方式来优化:三数取中,使选择的“标杆”能够尽量的将数组平均划分成两半,避免选择到边界值使时间复杂度退化到o(n^2);双指针操作,减少在对比时的交换次数;每次遍历集中放置与“标杆”相同的值,减少递归深度;#inc.
2022-05-05 15:58:06
890
原创 c++实现线程安全的单例模式
title: 单例模式categories: [设计模式]tags: [单例模式]我的私人博客饿汉模式#include <iostream>using namespace std;class HungrySingleton{private: int count = 0; static HungrySingleton* instance; HungrySingleton() = default;public: ~HungrySingleto.
2022-04-27 13:48:27
1957
3
原创 heapq 模块
heapq 模块标签(空格分隔): pythoncook笔记1. 查找最大或最小的N个元素(nlargest ,nsmallest)import heapqnums = [1, 8, 2, 23, 7, -4, 18, 23, 42, 37, 2]print(heapq.nlargest(3, nums)) # Prints [42, 37, 23]print(hea...
2018-04-09 16:26:47
316
原创 collections 模块
collections 模块标签(空格分隔): pythoncook笔记collections.deque用法:—— 创造简单队列 ——–使用deque(maxlen=N)会构建一个大小为N的简单队列,当新的元素加入并且这个队列已满时,最老的元素会被删除。>>> q = deque(maxlen=3)>>> q.append...
2018-04-09 16:24:44
131
原创 selenium 控制浏览器基础教学
selenium 控制浏览器基础教学标签(空格分隔): selenium python 在ubuntu下安装给python3装selenium在ubuntu在配置Firefox和chrome的drivergeckodriver下载地址 chromedriver下载地址 将其解压后放到/usr/bin目录下 (如果报错就将其放到/bin/目录下面)sudo...
2018-04-06 20:58:11
638
原创 BiliBili等网站极验滑动验证码的详细破解过程
基于selenium自动化的滑动验证码破解1.环境配置(Linux)python2.7pip安装的库:selenium , PILChrome浏览器 , Chromedriver (点击查看详细安装过程)2.示例网站(BiliBili)https://passport.bilibili.com/login3.代码整体流程图4.完整代码...
2018-03-30 13:41:41
12184
5
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人