544 views
1 1 vote
In double linked list organization, insertion and deletion of a record involves maximum modification of number of pointers respectively a. Four, Two b. Two, Two c. Four, Four d. Two, Four

1 Answer

Best answer
0 0 votes

Answer is A

Consider we want insert node P .

Then we need to update 4 pointers .

Update newly creeated node pointers (P-> next_pointe)r and (P-> Previous_pointer)

Want to insert node after node Q then update (Q -> next_pointer and Q->next_pointer_previous_pointer )

Total 4 updates

Example :

           If we want to delete node P then update ( P -> previus_pointer -> next_pointer = p->next_pointer ) and

         (P-> next_pointer -> previus_pointer = P -> Previous_pointer) 

For delete we need to update only two pointers 

Example :

           If we want to delete node P then update ( P -> previus_pointer -> next_pointer = p->next_pointer ) and

         (P-> next_pointer -> previus_pointer = P -> Previous_pointer) 

2 Updates

• selected by
Position:
Show:

Related questions

2 2 votes
1 1 answer
1.3k
1.3k views
Souvik33 asked Jan 11, 2023
1,260 views
The following C function rearranges the members of a single-linked list of integers that is passed as a parameter. The list of numbers 1, 2, 3, 4, 5, 6, and 7 in the spec...
0 0 votes
0 0 answers
759
759 views
Rahul Jain25 asked Nov 5, 2016
759 views
I am not getting how unsigned is used and how is it working???