跳过列表数据结构

A skip list is a data structure that is used for storing a sorted list of items with a help of hierarchy of linked lists that connect increasingly sparse subsequences of the items. A skip list allows the process of item look up in efficient manner. The skip list data structure skips over many of the items of the full list in one step, that’s why it is known as skip list.
跳过列表是一种数据结构,用于在链接列表的层次结构的帮助下存储项目的排序列表,该链接列表将越来越稀疏的项目子序列连接在一起。 跳过列表允许以高效的方式查找项目。 跳过列表数据结构一步一步跳过了整个列表的许多项目,这就是为什么它被称为跳过列表的原因。
Skip List Data Structure
Skip List
跳过清单

复杂 (Complexity)

 
Average Case
Worst Case
Space
O(n)
O(nlogn)
Search
O(logn)
O(n)
Insert
O(logn)
O(n)
Delete
O(logn)
O(n)
 
平均情况
最糟糕的情况
空间
上)
O(登录)
搜索
O(登录)
上)
O(登录)
上)
删除
O(登录)
上)

跳过清单的结构 (Structure of Skip List)

A skip list is built up of layers. The lowest layer (i.e. bottom layer) is an ordinary ordered linked list. The higher layers are like ‘express lane’ where the nodes are skipped (observe the figure).
跳过列表由图层组成。 最低层(即底层)是普通的有序列表。 较高的层就像“快车道”,其中的节点被跳过(观察图)。

搜索过程 (Searching Process)

When an element is tried to search, the search begins at the head element of the top list. It proceeds horizontally until the current element is greater than or equal to the target. If current element and target are matched, it means they are equal and search gets finished.
尝试搜索元素时,搜索从顶部列表的头元素开始。 它会水平进行,直到当前元素大于或等于目标为止。 如果当前元素和目标匹配,则意味着它们相等并且搜索完成。
If the current element is greater than target, the search goes on and reaches to the end of the linked list, the procedure is repeated after returning to the previous element and the search reaches to the next lower list (vertically).
如果当前元素大于目标,则搜索继续并到达链接列表的末尾,返回上一个元素后重复该过程,搜索(垂直)到达下一个下一个列表。

实施细节 (Implementation Details)

1. The elements used for a skip list can contain more than one pointers since they are allowed to participated in more than one list.
1.用于跳过列表的元素可以包含多个指针,因为允许它们参与多个列表。
2. Insertion and deletion operations are very similar to corresponding linked list operations.
2.插入和删除操作与相应的链表操作非常相似。
Insertion in Skip List Data Structure
Insertion in Skip List
插入跳过列表

跳过清单的应用 (Applications of Skip List)

1. Skip list are used in distributed applications. In distributed systems, the nodes of skip list represents the computer systems and pointers represent network connection.
1.跳过列表用于分布式应用程序。 在分布式系统中,跳过列表的节点表示计算机系统,而指针表示网络连接。
2. Skip list are used for implementing highly scalable concurrent priority queues with less lock contention (struggle for having a lock on a data item).
2.跳过列表用于实现具有较少锁争用(为在数据项上进行锁而努力)的高度可扩展的并发优先级队列。

翻译自: https://www.thecrazyprogrammer.com/2014/12/skip-list-data-structure.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值