R
R
Reslyukov Alexander2020-12-18 23:29:58
Algorithms
Reslyukov Alexander, 2020-12-18 23:29:58

How to implement this structure as two arrays: NAME and NEXT?

We were given tasks to prepare for the exam in the theory of algorithms.
He did everything perfectly, except for one task, which I don’t understand at all and I don’t remember that we did something like that. I looked through the entire training manual, where there are all the topics of my course, but I did not find it. Who studied, can you help with the assignment? Or at least indicate which topics to google, because I really went through everything I could, but it's useless.5fdd113d54316384969143.jpeg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
U
uvelichitel, 2020-12-19
@Alexandr_202

For example, the
NAME[EL1, EL2, EL3, EL3, EL4, EL5]
second one is quite often done this way - a connectivity array that stores links of a linked list,
NEXT[3, 5, 2, TAIL, 4]
which means that the first element of the list has a name NAME[1] = EL1and refers to, NEXT[1]=3that is, to NAME[3]=EL3(array indexing here starts from 1, not from zero because it is done in your example) Such a structure is quite compact and adds to the advantages of a linked list the advantage of a sequential array - direct access to elements.

E
Evgeny Petryaev, 2020-12-19
@Gremlin92

In one array there are values, and in another the order is a[b[n]]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question