Given a Linked List of length n and block length k rotate in a circular manner towards right/left each block by a number d. If… Read More
Given a Linked List of length n and block length k rotate in a circular manner towards right/left each block by a number d. If… Read More
Given a linked list, write a function to reverse every k nodes (where k is an input to the function). Examples: Input: 1->2->3->4->5->6->7->8->NULL and k =… Read More
Given a linked list, write a function to reverse every k nodes (where k is an input to the function). Examples: Input: 1->2->3->4->5->6->7->8->NULL and k =… Read More
Given a linked list, write a function to reverse every k nodes (where k is an input to the function). Examples: Input: 1->2->3->4->5->6->7->8->NULL and k =… Read More
Given a linked list, write a function to reverse every k nodes (where k is an input to the function). Examples: Input: 1->2->3->4->5->6->7->8->NULL and k =… Read More
Using pointers, loop through the whole list and keep track of the node prior to the node containing the last occurrence key using a special… Read More
Insert a node x after the nth node from the end in the given singly linked list. It is guaranteed that the list contains the… Read More
Insert a node x after the nth node from the end in the given singly linked list. It is guaranteed that the list contains the… Read More
Insert a node x after the nth node from the end in the given singly linked list. It is guaranteed that the list contains the… Read More
Insert a node x after the nth node from the end in the given singly linked list. It is guaranteed that the list contains the… Read More
Write a function detectAndCountLoop() that checks whether a given Linked List contains loop and if loop is present then returns count of nodes in loop.… Read More
Write a function detectAndCountLoop() that checks whether a given Linked List contains loop and if loop is present then returns count of nodes in loop.… Read More
Write a function detectAndCountLoop() that checks whether a given Linked List contains loop and if loop is present then returns count of nodes in loop.… Read More
Write a function detectAndCountLoop() that checks whether a given Linked List contains loop and if loop is present then returns count of nodes in loop.… Read More