278 views
1 votes
1 votes
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 votes
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

Related questions

0 votes
0 votes
0 answers
2
Rahul Jain25 asked Nov 5, 2016
480 views
I am not getting how unsigned is used and how is it working???
0 votes
0 votes
1 answer
3
Mrityudoot asked Feb 25
144 views
How can we find the highest element in a singly linked list in O(1)? We are free to use any extra space.