Wiwi's Blog


  • Home

  • About

  • Tags

  • Categories

  • Search

并查集 Disjoint Set

Posted on 2020-08-08 | In 学习笔记:数据结构
Words count in article: 1.2k | Reading time ≈ 4

并查集(Disjoint Set)

互不相交的数据集合。用一个代表元素来识别每个集合,这个元素属于这个集合。基本操作如下:
Make-Set:建立一个新的单元素集合
Find:判断元素在哪个集合中。可用于判断两个元素是都属于同一集合。
Union:把一个集合中的元素并入另一个集合中。
该数据结构可用于确定无向图的连通分量:对每个顶点make-set,遍历每一条边对每条边的两顶点的所在set进行union,最终得到的set的集合就是无向图的连通分量。

Read more »

图算法

Posted on 2020-08-08 | In 学习笔记:算法
Words count in article: 2.5k | Reading time ≈ 11

完整代码见:https://github.com/huangliu0909/Graph-Algorithms

基本图算法

深度优先搜索 DFS

使用栈(First-In-Last-Out),起始点入栈,当栈不为空时,pop,如果这个点未被访问,则标记为已访问,加入结果数组,将与这个点相连的顶点逐个入栈,循环直到栈为空。

Read more »

比较排序 - 3:快排 堆排 平滑 内省 奇偶

Posted on 2020-08-04 | In 学习笔记:算法
Words count in article: 527 | Reading time ≈ 2

完整排序算法代码:https://github.com/huangliu0909/Sort-Algorithms

快速排序 Quicksort

快速排序是一种分治算法,不断找到pivot元素,将比它小的放在它左边,比它大的放在右边。双指针从头、从末尾分别开始与pivot比较,如果满足则移动,如果不满足则交换。

Read more »

比较排序 - 2:归并 timsort 桶排序 圈排序

Posted on 2020-08-03 | In 学习笔记:算法
Words count in article: 919 | Reading time ≈ 4

完整排序算法代码:https://github.com/huangliu0909/Sort-Algorithms

归并排序 Merge sort

分治法,每次将一个数组均分成两部分,对这两部分进行merge。

Read more »

比较排序 - 1:选择 插入 冒泡 鸡尾酒 希尔

Posted on 2020-08-02 | In 学习笔记:算法
Words count in article: 803 | Reading time ≈ 3

Comparison sort

“A comparison sort is a type of sorting algorithm that only reads the list elements through a single abstract comparison operation (often a “less than or equal to” operator or a three-way comparison) that determines which of two elements should occur first in the final sorted list. The only requirement is that the operator forms a total preorder over the data, with:
if a ≤ b and b ≤ c then a ≤ c (transitivity)
for all a and b, a ≤ b or b ≤ a (connexity).”
From Wikipedia

完整排序算法代码:https://github.com/huangliu0909/Sort-Algorithms

Read more »

计数排序 & 基数排序

Posted on 2020-08-01 | In 学习笔记:算法
Words count in article: 730 | Reading time ≈ 3

计数排序 Counting sort

“In computer science, counting sort is an algorithm for sorting a collection of objects according to keys that are small integers; that is, it is an integer sorting algorithm. It operates by counting the number of objects that have each distinct key value, and using arithmetic on those counts to determine the positions of each key value in the output sequence. “ From Wikipedia

完整排序算法代码:https://github.com/huangliu0909/Sort-Algorithms

Read more »

数据库

Posted on 2020-07-29 | In 面试准备
Words count in article: 665 | Reading time ≈ 2
expoll了解吗MVCC数据库事务隔离级别多人同时使用数据库的注意事项MySQL与其他主流数据库相比有什么特点?事务的四大特性四种隔离级别什么是幻读InnoDB 怎么防止幻读B+树原理,为什么使用B+而不是二叉平衡树为什么要分用户态和内核态用户态和内核态的区别Git 切换分支,提交,具体如何合并分支数据库部分知识,手写一个 SQL (子查询 感觉主要看 group by 和 having)MyS ...
Read more »

Python

Posted on 2020-07-28 | In 面试准备
Words count in article: 915 | Reading time ≈ 3

Python

Python可变参数args,*kwargs

当函数的参数前面有一个星号的时候表示这是一个可变的位置参数
两个星号表示这个是一个可变的关键词参数。
星号把序列或者集合解包(unpack)成位置参数,两个星号*把字典解包成关键词参数。

Python内置容器及其容器及其使用场景

Read more »

计算机网络

Posted on 2020-07-27 | In 面试准备
Words count in article: 11k | Reading time ≈ 39

锁

锁(lock)或互斥(mutex)是一种同步机制,用于在有许多执行线程的环境中强制对资源的访问限制。锁旨在强制实施互斥排他、并发控制策略。

常见锁机制

读写锁、可重入锁、乐观锁、悲观锁、公平锁、非公平锁

Read more »

树结构 Tree

Posted on 2020-07-20 | In 学习笔记:数据结构
Words count in article: 36 | Reading time ≈ 1
二叉搜索树一棵搜索树既可以作为一个字典又可以作为一个优先队列。 红黑树B树B+树
Read more »
Return1…567Next Page

HUANG Liu

Love always wins.

65 posts
12 categories
22 tags
GitHub E-Mail
0%
© 2021 HUANG Liu | Site words total count: 74.9k
Powered by Hexo
|
Theme — NexT.Pisces v5.1.4