GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Concepts  >  Data Structures

 Print  |  
Question:  Double Linked List

Answer: Make a middle node of doubly link list to the top of the list.


August 08, 2009 08:58:39 #1
 ravi6771   Member Since: August 2009    Total Comments: 3 

RE: Double Linked List
 
let suppose x is the node to be moved to top


x->next->prev=x->prev;
x->prev->next=x->prev->next->next;
x->next=head;
head->prev=x;
head=x;
     

 

Back To Question