由两个带有指针和值的链接列表组成的图形 [英] Drawing consisting of two linked lists with pointers and values
问题描述
我刚刚开始学习算法课程,但是由于一些家庭问题,我没有机会参加前两个讲座。现在我有点不高兴,因为我对所发生的事情不太了解。
I just started taking an algorithms course, however, due to some family issues, I did not have a chance to participate in the first two lectures. Now I'm in a bit of a pickle, because I don't understand much of what is going on.
上面是我需要完成的任务的图片解决。据我了解,L0是包含S的所有值的列表,而L1是包含S的所有值的列表和指向L0中对应值的指针。但是,我不了解的是何时开始引入增量和图形。如果有人可以阐明delta的含义以及参数delta = 3,那么我可能有机会解决它。
Above is a picture of a task that I need to solve. From what i understand, L0 is a list containing all values of S and L1 is a list containing all values of S and a pointer to the corresponding value in L0. However, what I do not understand is when they start bringing in delta and drawings. If anyone could clarify the meaning of delta and the parameter delta = 3, I might have a chance of solving it.
我们将提供任何帮助。
Any help is appreciated.
推荐答案
在这里,增量只是一个参数。
Here, 'delta' is just a parameter. You can call it 'd' if you prefer.
L0包含S的所有元素(作为链接列表)。
L1包含S的每个 delta元素作为链表,并带有指向L0中相应值的指针。
L0 contains all elements of S (as a linked list). L1 contains every 'delta'th element of S as a linked list, with a pointer to the corresponding value in L0.
所以对2.1的回答是
L0: 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8
^ ^ ^
| | |
L1: 1 -----------> 4 -----------> 7
即L1包含0th,3rd和6th(i = 0,delta,2 * delta,其中delta = 3)的S元素。
That is, L1 contains the 0th, 3rd, and 6th (i=0, delta, 2*delta, where delta=3) element of S.
这篇关于由两个带有指针和值的链接列表组成的图形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!