![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构和算法
bookxiao
这个作者很懒,什么都没留下…
展开
-
跳跃表以及在redis中的实现
1 什么是跳跃表 以下是摘至维基百科关于跳跃表的描述: 跳跃列表是在基础链表的基础上按层建造的。底层是一个普通的有序链表。每个更高层都充当下面列表的“快速跑道”,这里在第i层中的元素按某个固定的概率p出现在第i+1层中。 查找一个目标元素,从顶层列表和头元素起步,并沿着每层链表搜索。如果在一层列表中找到的元素等于目标元素,则表明该元素直接被找到。当在一层列表中查找到小于目标的元素时,就切换...原创 2019-01-04 11:27:15 · 723 阅读 · 0 评论 -
UVa210 - Concurrency Simulator
主要涉及双端队列和单端队列的使用。 #include <stdio.h> #include <queue> #include <string> #include <cstring> enum StatementType { ASSIGN = 0, PRINT, LOCK, UNLOCK, END }; st...原创 2019-05-22 14:45:22 · 215 阅读 · 0 评论 -
UVa 514 - Rails
主要是栈的灵活使用。 #include <stdio.h> #include <stack> int target[1000+10] = {0}; int main() { int n; while(scanf("%d", &n) == 1) { if(n == 0) break; f...原创 2019-05-22 17:32:56 · 203 阅读 · 0 评论