Home Manual Reference Source

Function

Static Public Summary
public

Node(key: *, down: undefined, left: undefined, right: undefined, up: undefined)

public

SkipList(p: Number, compare: Function, head: Node)

public

bottomMostPredecessor(compare: *, node: *, key: *): *

public

* debug(skiplist: *)

public
public

downMost(node: *): *

public

heads(bias: *)

public

insertFromBottomMostPredecessor(p: *, pred: *, key: *): *

public

* iter(head: *)

public

* iterDown(head: *)

public

* keys(level: *)

public

makeBottomLevel(compare: *, iterable: *): *

public

makeDeterministic(p: *, head: *): *

Make a balanced Skip-list with p = 1/2.

public

makeQuasiRandom(p: *, head: *): *

Make a balanced Skip-list with p = 1/2 but randomizing the choice of promoted nodes at each level.

public

node(key: *, down: undefined, left: undefined, right: undefined, up: undefined): *

public
public

searchTopMost(compare: *, node: *, key: *): *

Static Public

public Node(key: *, down: undefined, left: undefined, right: undefined, up: undefined) source

Params:

NameTypeAttributeDescription
key *
  • optional
  • default: undefined
down undefined
  • optional
  • default: undefined
left undefined
  • optional
  • default: undefined
right undefined
  • optional
  • default: undefined
up undefined
  • optional
  • default: undefined

public SkipList(p: Number, compare: Function, head: Node) source

Params:

NameTypeAttributeDescription
p Number

Promotion probability in (0,1).

compare Function
head Node

public bottomMostPredecessor(compare: *, node: *, key: *): * source

import bottomMostPredecessor from '@data-structure/skip-list/src/bottomMostPredecessor.js'

Params:

NameTypeAttributeDescription
compare *
node *
key *

Return:

*

public * debug(skiplist: *) source

Params:

NameTypeAttributeDescription
skiplist *

public deleteFromTopMost(node: *) source

Params:

NameTypeAttributeDescription
node *

public downMost(node: *): * source

Params:

NameTypeAttributeDescription
node *

Return:

*

public heads(bias: *) source

Params:

NameTypeAttributeDescription
bias *
  • optional

public insertFromBottomMostPredecessor(p: *, pred: *, key: *): * source

import insertFromBottomMostPredecessor from '@data-structure/skip-list/src/insertFromBottomMostPredecessor.js'

Params:

NameTypeAttributeDescription
p *
pred *
key *

Return:

*

public * iter(head: *) source

Params:

NameTypeAttributeDescription
head *

public * iterDown(head: *) source

Params:

NameTypeAttributeDescription
head *

public * keys(level: *) source

Params:

NameTypeAttributeDescription
level *

public makeBottomLevel(compare: *, iterable: *): * source

Params:

NameTypeAttributeDescription
compare *
iterable *

Return:

*

public makeDeterministic(p: *, head: *): * source

Make a balanced Skip-list with p = 1/2.

Params:

NameTypeAttributeDescription
p *
head *

Return:

*

public makeQuasiRandom(p: *, head: *): * source

Make a balanced Skip-list with p = 1/2 but randomizing the choice of promoted nodes at each level.

Params:

NameTypeAttributeDescription
p *
head *

Return:

*

public node(key: *, down: undefined, left: undefined, right: undefined, up: undefined): * source

Params:

NameTypeAttributeDescription
key *
  • optional
  • default: undefined
down undefined
  • optional
  • default: undefined
left undefined
  • optional
  • default: undefined
right undefined
  • optional
  • default: undefined
up undefined
  • optional
  • default: undefined

Return:

*

public predecessorOnPreviousLevel(node: *): * source

import predecessorOnPreviousLevel from '@data-structure/skip-list/src/predecessorOnPreviousLevel.js'

Params:

NameTypeAttributeDescription
node *

Return:

*

public searchTopMost(compare: *, node: *, key: *): * source

Params:

NameTypeAttributeDescription
compare *
node *
key *

Return:

*