Home > Back-end >  The beginner's data structure
The beginner's data structure

Time:09-29

A double linked list, if P points to ai node, then nodes location S P?

CodePudding user response:

Need to work a pointer P1 refers to the precursor node P, S - & gt; Next=P; P1 - & gt; Next=S; P - & gt; The prior=S; S - & gt; The prior=p;

CodePudding user response:

What do you mean p ai's next? Then between p and ai, to join s right? See below if it is,
 
S - & gt; Next=p - & gt; next;
p-> Next=s;
S - & gt; next-> Prev=s;
S - & gt; Prev=p;

CodePudding user response:

refer to the second floor, Michael amin's reply:
what do you mean p ai's next? Then between p and ai, to join s right? See below if it is,
 
S - & gt; Next=p - & gt; next;
p-> Next=s;
S - & gt; next-> Prev=s;
S - & gt; Prev=p;

Thank you
Problem has been solve

CodePudding user response:

reference m0_46635539 reply: 3/f
Quote: refer to the second floor, Michael amin's reply:
what do you mean p ai's next? Then between p and ai, to join s right? See below if it is,
 
S - & gt; Next=p - & gt; next;
p-> Next=s;
S - & gt; next-> Prev=s;
S - & gt; Prev=p;

Thank you
Problem has been solve


Ok, come on!
  • Related