Skip to main content

18 docs tagged with "Linked List"

View All Tags

Add Two Numbers

You are given two non-empty linked lists representing two non-negative integers...

Linked List Cycle

Given head, the head of a linked list, determine if the linked list has a cycle in it.

Linked List Cycle II

Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null.

LRU Cache

Design a data structure that follows the constraints of a Least Recently Used (LRU) cache.

Odd Even Linked List

Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordered list.

Palindrome Linked List

Given the head of a singly linked list, return true if it is a palindrome or false otherwise.

Remove Linked List Elements

Given the head of a linked list and an integer val, remove all the nodes of the linked list that has Node.val == val, and return the new head.

Reorder List

You are given the head of a singly linked-list...

Reverse Linked List

Given the head of a singly linked list, reverse the list, and return the reversed list.

Reverse Linked List II

Given the head of a singly linked list and two integers left and right where left <= right, reverse the nodes of the list from position left to position right, and return the reversed list.

Reverse Nodes in k-Group

Given the head of a linked list, reverse the nodes of the list k at a time, and return the modified list.

Rotate List

Given the head of a linked list, rotate the list to the right by k places.

Sort List

Given the head of a linked list, return the list after sorting it in ascending order.

Swap Nodes in Pairs

Given a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list's nodes (i.e., only nodes themselves may be changed.)