自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(14)
  • 收藏
  • 关注

原创 linux 库与连接

动态连接的使用, 静态库和动态库的优缺点, 使用ld.so.preload拦截动态库

2023-02-10 16:02:55 467 1

原创 python 条件锁详解

python条件锁使用规范, 条件锁的三个陷阱, 条件锁的内部实现, 以及条件锁的必要性

2023-02-10 15:05:44 582

原创 Leetcode 653. Two Sum IV - Input is a BST

Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target.Example 1:Input: 5 / \ 3 6 / \ ...

2018-11-04 00:30:37 173

原创 Leetcode 454. 4Sum II

问题Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such that A[i] + B[j] + C[k] + D[l] is zero.To make problem a bit easier, all A, B, C, D have same ...

2018-10-20 23:13:23 170

原创 Leetcode 18. 4Sum

问题Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum o...

2018-08-31 21:22:48 131

原创 LeetCode 15. 3Sum

问题Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:The solution set must not...

2018-08-31 13:46:33 126

原创 归并排序的优化

归并排序的时间复杂度为, 插入排序的时间复杂度为, 当需要排序的数组足够长时,归并排序肯定比插入排序更快,但当数组长度比较小的时候,常量因子起主导作用,由于插入排序的常量因子比较小,插入排序比归并排序更快。所以有一个常见的对归并排序的优化:当递归排序的子问题变得足够小时,不继续递归调用归并排序,而是直接调用插入排序。有两种做法:自顶向下,指定需要使用插入排序的子问题的大小。 自底向上...

2018-08-14 09:10:54 1222 1

原创 Leetcode 1. Two Sum

Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the same...

2018-08-13 01:24:14 135

原创 汉诺塔问题

汉诺塔(港台:河内塔)是根据一个传说形成的数学问题:有三根杆子A,B,C。A杆上有 N 个 (N>1) 穿孔圆盘,盘的尺寸由下到上依次变小。要求按下列规则将所有圆盘移至 C 杆:每次只能移动一个圆盘;大盘不能叠在小盘上面。提示:可将圆盘临时置于 B 杆,也可将从 A 杆移出的圆盘重新移回 A 杆,但都必须遵循上述两条规则。问:如何移?最少要移动多少次? 解析解决汉...

2018-07-28 17:04:15 539

原创 洗牌问题——偶数张扑克牌,分成两等份, 洗牌多少次回到原来顺序?

使用群论,将洗牌问题从复杂繁琐的编程问题变为简洁优雅的数学问题

2016-09-11 17:01:59 1971 1

原创 sicp中stream的python实现

sicp中stream的python实现及其应用

2016-08-31 18:25:10 1296

原创 markdown语法备忘录

markdown语法复习

2016-04-21 17:36:26 701

原创 程序优化技巧——如何将一个程序加速一百倍

本文展示了如何将一个使用蒙特卡洛方法计算圆周率的C语言程序加速一百倍

2016-03-18 11:52:25 2727

原创 Python Exception 错误信息输出机理

当遇到一个如下的exception时,最后一行错误信息是从何而来的呢? >>> 2 / 0 Traceback (most recent call last): File “”, line 1, in ZeroDivisionError: integer division or modulo by zero

2016-03-04 23:28:39 1159

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除