English 中文(简体)
如何初步编制一个跳板清单?
原标题:How a skip list is initialized?

I m reading the William Pugh s paper about skip-list. In section Initialization he says:

An element NIL is given a key greater than any legal key. All levels of all skip lists are terminated with NIL. A new list is initialized so that the level of the list is equal to 1 and all forward pointers of the list’s header point to NIL.

I m not sure of what he says. I think that he means: Let be n the maximum permitted level for each node. So build an header of level n. In a first step each level of the header points to NIL. It s right?

如今,当第一场节点到达时,将以一种有利于团结的方式加以插入,因此其程度不应预测。 他为什么谈一级名单? 失踪的人是什么?

最佳做法

MC

问题回答

我可以读到该文件,但如果我正确回顾,那么,NIL是清单中的一项内容,而其level大于任何有效的level,以确保其始终是最后一个项目。 请允许我说,您的级别从13,然后请将NILs的级别改为4。 当你制定一份新的履历清单时,它就应当这样做:

H = Header
N = Nil
   _    _
4 |H|->|N| 
3 |H|->|N| <- max for normal elements
2 |H|->|N|
1 |H|->|N|

在你补充了几个要素之后,你:

   _                   _
4 |H|---------------->|N| 
3 |H|-------|B|------>|N|
2 |H|-------|B|->|C|->|N|
1 |H|->|A|->|B|->|C|->|N|

空缺名单(新名单)应有级别 1. 导言 插入期间(以后)需要增加更多数量。





相关问题
The Fastest DataStructure to Filter with in C#

Currently we are filtering and sorting data with a datatable. /// <summary> /// Filters the data table and returns a new data table with only the filtered rows. /// </summary>...

Efficient queue in Haskell

How can I efficiently implement a list data structure where I can have 2 views to the head and end of the list, that always point to a head a tail of a list without expensive calls to reverse. i.e: ...

Java large datastructure for storing a matrix

I need to store a 2d matrix containing zip codes and the distance in km between each one of them. My client has an application that calculates the distances which are then stored in an Excel file. ...

Holding onto items after a postback

I have an ASP.NET web application and I want to be able to take items from a master list and store them temporarliy into one of four other lists. The other lists need to survive post backs so that ...

negative number in the stack

I am a new student in the compilers world ^_^ and I want to know is legal represent negative number in the stack. For example: infix: 1-5=-4 postfix: 15- The statements are: push(1) push(5) x=...

What type of struct/container would you use in this instance?

I am trying to figure out what type of structure or container I should use for a quick project. I need to have an unknown number of sets that will be entered from the GUI (each one will have a name, ...

热门标签