Giter Club home page Giter Club logo

skiplist's Introduction

SkipList

Build Status

A Java implementation of skip list.

跳表的Java语言实现。

Introduction

Skip lists are data structures that use probabilistic balancing rather than strictly enforced balancing. As a result, the algorithms for insertion and deletion in skip lists are much simpler and significantly faster than equivalent algorithms for balanced trees.

跳表是90年代由William Pugh发明的一种概率平衡数据结构。跳表的平衡是一种基于随机的非严格平衡。它完全基于链表实现,而不涉及树的结构,和普通的平衡树相比, 跳表的新增和删除操作实现相对简单很多。跳表的核心**就是将扁平的列表进行分层,每个节点在插入的时候会生成一个随机的层数,基于此随机的层数与跳表中相邻的数据连接。 跳表的增删改查操作具有O(log N)的均摊复杂度。

Implementation

The SkipListMap uses skip list as the underlying essential data structure and implements java.util.Map. Two extra sentinel nodes(head and tail) are used for the sake of convenience. The SkipListMap is generic and supports particular comparision function by passing a custom java.util.Comparator to the constructor.

SkipListMap是基于跳表的实现的map。 基本思路与跳表原著论文一致,在实现时为了方便起见,加入了head和tail两个哨兵节点。

Todo List

  • Implement java.util.NavigableMap interface.
  • Add more test cases.

Reference

License

MIT License

skiplist's People

Contributors

dependabot[bot] avatar mottox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

skiplist's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.