Given the heads of two singly linked-lists headA and headB, return the node at which the two lists intersect. If the two linked lists…
Browsing: Singly Linked List
Given the head of a linked list where nodes can contain values 0s, 1s, and 2s only. Your task is to rearrange the list so that all 0s appear at the beginning,…
Given the head of a linked list, return the list after sorting it in ascending order. Here’s the [Problem Link] to begin with. Example…
You are given the head of a linked list. Delete the middle node, and return the head of the modified linked list. The middle node of a linked list of…
Given the head of a linked list, remove the nth node from the end of the list and return its head. Here’s the [Problem…
Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even…
Given the head of a singly linked list, return true if it is a palindrome or false otherwise. Here’s the [Problem Link] to begin with. Example 1: Input:…
Given the head of a linked list, determine whether the list contains a loop. If a loop is present, return the…
Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null. Here’s the [Problem…
Given head, the head of a linked list, determine if the linked list has a cycle in it. There is a cycle in a linked…