Home > Back-end >  Singly linked list data structure in the tail interpolation r=s this step is what mean
Singly linked list data structure in the tail interpolation r=s this step is what mean

Time:10-11

R and s are not address? The r=s is not assigned to r s address? What's the point?

CodePudding user response:

R and s are variable, but their memory of an address information, r=s s memory information is copied to the r, because s memory information is an address, so r also modify memory information into an address, in this figure is you r and s all point to the an, quite is move r to s position (i.e., r and s are the an this position)

CodePudding user response:

reference 1st floor qybao response:
r and s are variable, but their memory of an address information, r=s s memory information is copied to r, because s memory information is an address, so r also modify memory information into an address, in this figure is you r and s all point to the an, quite is move r to s position (i.e., r and s are the an this position)

Who is r and s are only addresses? And r and s all point to the an is because r=s this step so r pointing to an operation, and store their s itself so r and s are pointing to an address an?

CodePudding user response:

refer to the second floor qq_43238217 response:
Quote: refer to 1st floor qybao response:
r and s are variable, but their memory of an address information, r=s s memory information is copied to r, because s memory information is an address, so r also modify memory information into an address, in this figure is you r and s all point to the an, quite is move r to s position (i.e., r and s are the an this position)

Who is r and s are only addresses? And r and s all point to the an is because r=s this step so r pointing to an operation, and store their s itself so r and s are pointing to an address an?

And r nodes by r, r -> next, composed of the data?

CodePudding user response:

You need to understand one thing
New node, it is in memory of, this thing is only a portion (the memory of a next properties - pointer)
But you can get 100 pointer variable, all point to this address, this can understand,

Are you going to do the work is not about how these variables, but for the next node pointer to the next memory block

R and s are the middle variable, temporary use only

So, you always see, the memory block on the next is how to change

CodePudding user response:

R is a pointer to the current memory block
S is to point to to hang the memory block pointer

So r - & gt; Next=s; No, the relationship between this and r actually fart is r pointing to the next properties on the block of memory, is set to be articulated blocks of memory addresses the
Later on, will continue to hang a memory block under the
In order to keep r is always the meaning of the memory block, it would not have been at the back of the r=s
S? Immediately came in the next cycle, s will return again to the new memory blocks to be articulated

CodePudding user response:

R is a variable, which points to a memory address, the memory address to store the data and information on next
Such as r was the postman and he now to zhang SAN's home, to the house of zhang put a package (data) and a bill the house brands (next), at this point, the other is a postman s Li Sijia, s (r=s) r going to meet, so came to Li Sijia r, r and s are Li Sijia,

CodePudding user response:

Fun
reference 4 floor response:
you need to understand one thing
New node, it is in memory of, this thing is only a portion (the memory of a next properties - pointer)
But you can get 100 pointer variable, all point to this address, this can understand,

Are you going to do the work is not about how these variables, but for the next node pointer to the next memory block

R and s are the middle variable, temporary use only

So, you always see, the memory block on the next is how to change

Does that mean r and s is not merely an - 1 and the an, if there's an + 1 behind, the an a + 2, r and s will also as the intermediate variable for them

CodePudding user response:

Fun
reference 5 floor response:
r is a pointer to the current memory block
S is to point to to hang the memory block pointer

So r - & gt; Next=s; No, the relationship between this and r actually fart is r pointing to the next properties on the block of memory, is set to be articulated blocks of memory addresses the
Later on, will continue to hang a memory block under the
In order to keep r is always the meaning of the memory block, it would not have been at the back of the r=s
S? Immediately came in the next cycle, s will return to the new want to hook up the block of memory to

Thank you bosses

CodePudding user response:

reference qq_43238217 reply: 3/f
Quote: refer to the second floor qq_43238217 response:
Quote: refer to 1st floor qybao response:
r and s are variable, but their memory of an address information, r=s s memory information is copied to r, because s memory information is an address, so r also modify memory information into an address, in this figure is you r and s all point to the an, quite is move r to s position (i.e., r and s are the an this position)

Who is r and s are only addresses? And r and s all point to the an is because r=s this step so r pointing to an operation, and store their s itself so r and s are pointing to an address an?

And r nodes by r, r -> next, composed of the data?

Thank you bosses

CodePudding user response:

Tail interpolation can need not so many temporary variables, one is enough
S is the current of the memory block pointer
S - & gt; Next=new/malloc new block
S - & gt; Next - & gt; next=NULL;
S - & gt; Next - & gt; The date=assignment
S=s - & gt; Next; Has now become a current node
In this way, you can see clearly the

Is nothing more than the s - & gt; Next in the previous example using a different temporary pointer r instead, make the code written to shorter, that's all
The key or the next on the memory block attributes to hook up

CodePudding user response:

Thank you bosses love you
  • Related