Skip List vs. Binary Search Tree

前端 未结 7 1819
广开言路
广开言路 2020-11-28 16:57

I recently came across the data structure known as a skip list. It seems to have very similar behavior to a binary search tree.

Why would you ever want to use a ski

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-28 17:48

    Skip Lists do have the advantage of lock stripping. But, the runt time depends on how the level of a new node is decided. Usually this is done using Random(). On a dictionary of 56000 words, skip list took more time than a splay tree and the tree took more time than a hash table. The first two could not match hash table's runtime. Also, the array of the hash table can be lock stripped in a concurrent way too.

    Skip List and similar ordered lists are used when locality of reference is needed. For ex: finding flights next and before a date in an application.

    An inmemory binary search splay tree is great and more frequently used.

    Skip List Vs Splay Tree Vs Hash Table Runtime on dictionary find op

提交回复
热议问题