How would you make the middle node of a doubly linked list to the top of the list? Let assume "x" is the middle node
Answers
Answered by
5
Answer:
x->left=head;
head=x;
Answered by
2
Answer:
We have to first find the middle node of a doubly-linked list through an algorithm and programming and then after finding the middle node we can assign it to the top of the list by traversing and reaching it at the top to add the same.
Explanation:
- Doubly linked list is a data structure in which there is a link pointing to the previous block and one link pointing to the next block.
- A time will also come where the last node will be linked with the first node then this condition will be known as a circular linked list.
- Each node has three fields: one filed has data and the other two have links to point in next and previous direction.
Similar questions
Social Sciences,
6 months ago
Sociology,
6 months ago
Environmental Sciences,
6 months ago
Math,
1 year ago
Math,
1 year ago