GATE CSE
First time here? Checkout the FAQ!
x
+1 vote
76 views
In double linked list organization, insertion and deletion of a record involves maximum modification of number of pointers respectively ___________________
asked in DS by Veteran (52.5k points)   | 76 views
4 nd 2 resp.

See the code

P---------->Q------------->R

P,R are 2 nodes, and in 1st code we are inserting Q

q->next=p->next;
p->next=q;
q->prev=p->next->prev;
r->prev=q->next->prev;

 

p->next=p->next->next;
r->prev=r->prev->prev;

Here in this 2nd code P,Q, R are 3 nodes, and we want to delete Q from it.

just a simple example to understand the code :)

plzz explain little more.. i m nt getting u...
if you just talk about modification of existing pointers then it should be 2 for insertion.

1 Answer

0 votes
in insertion,Maximum number of modified Pointers=4

in deletion it is 2
answered by Veteran (18.3k points)  


Top Users Mar 2017
  1. rude

    5246 Points

  2. sh!va

    3054 Points

  3. Rahul Jain25

    2920 Points

  4. Kapil

    2732 Points

  5. Debashish Deka

    2602 Points

  6. 2018

    1574 Points

  7. Bikram

    1444 Points

  8. Vignesh Sekar

    1440 Points

  9. Akriti sood

    1424 Points

  10. Sanjay Sharma

    1128 Points

Monthly Topper: Rs. 500 gift card

21,556 questions
26,908 answers
61,270 comments
23,278 users