18. Reverse the doubly link list.
19. Doubly link list a single pointer.
20. Reverse the link list with ‘k’ nodes.
21. Find a list in palindrome or not.
19. Doubly link list a single pointer.
20. Reverse the link list with ‘k’ nodes.
21. Find a list in palindrome or not.
18. Reverse the doubly link list.
ReplyDeleteFor ( p = head; p->next != head; p = p->prev )
Swap (&p->next,&p->prev);
19. Doubly link list a single pointer.
While storing the address store address as xor of the previous and next.
20. Reverse the link list with ‘k’ nodes.
Take the k+1 the element pointer and put as the next for first element . Reverse the K sized list .
21. Find a list in palindrome or not.
a) Find the middle node, reverse link list after that. Start comparing from head and the node after the middle node.