File tree 7 files changed +17
-5
lines changed
7 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 1
1
# QPS Counter
2
2
3
3
统计各接口QPS计数
4
- 使用一个双向循环链表结构
4
+ 使用一个双向循环链表结构
5
+
6
+
7
+
Original file line number Diff line number Diff line change 6
6
7
7
## 链表
8
8
9
- 这个就不介绍了。重点说下双向链表。
9
+ ### 应用场景
10
+
11
+ * [ redis slowlog] ( Redis%20slowlog.md )
10
12
11
13
12
14
### 扩缩容
@@ -18,6 +20,8 @@ java 中扩容,每次扩容新增原先容量的 1/2
18
20
int newCapacity = oldCapacity + (oldCapacity >> 1);
19
21
```
20
22
23
+ 这个就不介绍了。重点说下双向链表。
24
+
21
25
22
26
## 双向链表
23
27
@@ -38,6 +42,7 @@ typedef struct Entry{
38
42
39
43
最后一个节点指针指向头节点的链表
40
44
45
+ [ QPS 计数器实现] ( QPS%20Counter.md )
41
46
42
47
43
48
## 双向循环链表
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 6
6
* 散列函数设计
7
7
* 冲突处理
8
8
* hashmap数据结构
9
- * Java 中HashMap实现
9
+
10
+ [ Golang 中HashMap实现] ( HashMap%20in%20Golang.md )
11
+ [ Java 中HashMap实现] ( HashMap%20in%20Java.md )
12
+ [ Java 中LinkedHashMap实现] ( LinkedHashMap.md )
13
+ [ Java 中TreeMap实现] ( TreeMap%20in%20Java.md )
10
14
11
15
12
16
散列表使用某种算法操作(散列函数)将键转化为数组的索引来访问数组中的数据,这样可以通过Key-value的方式来访问数据,达到常数级别的存取效率。现在的nosql数据库都是采用key-value的方式来访问存储数据。
29
33
30
34
散列函数就是将键转化为数组索引的过程。且这个函数应该易于计算且能够均与分布所有的键。
31
35
32
- 散列函数最常用的方法是` 除留余数法 ` 。这时候被除数应该选用` 素数 ` ,这样才能保证键值的均匀散步 。
36
+ 散列函数最常用的方法是` 除留余数法 ` 。这时候被除数应该选用` 素数 ` ,这样才能保证键值的均匀散布 。
33
37
34
38
散列函数和键的类型有关,每种数据类型都需要相应的散列函数;比如键的类型是整数,那我们可以直接使用` 除留余数法 ` ;这里特别说明下,大多数情况下,键的类型都是字符串,这个时候我们任然可以使用` 除留余数法 ` ,将字符串当做一个特别大的整数。
35
39
Original file line number Diff line number Diff line change 22
22
* 链表
23
23
* 双向链表
24
24
25
- ### [ 队列] ( 2%20List/Queue .md )
25
+ ### [ 队列] ( 2%20Queue/README .md )
26
26
27
27
* 队列
28
28
* 堆栈
You can’t perform that action at this time.
0 commit comments