MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / newSkipList

Function newSkipList

structure/zset.go:181–186  ·  view source on GitHub ↗

newSkipList is a function that creates an instance of a SkipList struct object and returns a pointer to it. This involves initializing the level of the SkipList to 1 and creating a new SkipListNode object as the head of the list. The head node is constructed with a level set to SKIPLIST_MAX_LEVEL, k

()

Source from the content-addressed store, hash-verified

179// This involves initializing the level of the SkipList to 1 and creating a new SkipListNode object as the head of the list.
180// The head node is constructed with a level set to SKIPLIST_MAX_LEVEL, key and value as empty string and value as nil respectively.
181func newSkipList() *SkipList {
182 return &SkipList{
183 level: 1,
184 head: newSkipListNode(SKIPLIST_MAX_LEVEL, 0, "", nil),
185 }
186}
187
188// newSkipListNode is a function that takes integer as level, score and a string as key along with a value of any type.
189// It returns a pointer to a SkipListNode. This function is responsible for creating a new SkipListNode with provided level, score,

Callers 5

TestNewSkipListFunction · 0.85
TestFZSetMinMaxFunction · 0.85
TestZset_getNodeByRankFunction · 0.85
newZSetNodesFunction · 0.85
InsertNodeMethod · 0.85

Calls 1

newSkipListNodeFunction · 0.85

Tested by 3

TestNewSkipListFunction · 0.68
TestFZSetMinMaxFunction · 0.68
TestZset_getNodeByRankFunction · 0.68