LeetCode – 206. Reverse Linked List
Reverse a singly linked list. 这道题非常基础,需要熟练掌握 /** * Definition for singly-linked list. * public class…
LeetCode – 2. Add Two Numbers
You are given two non-empty linked lists representing two non-negative integers. The digits are stor…
LeetCode – 21. Merge Two Sorted Lists
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing t…
237. Delete Node in a Linked List
Write a function to delete a node (except the tail) in a singly linked list, given only access to th…
LeetCode – 86. Partition List
Given a linked list and a value x, partition it such that all nodes less than x come before nodes gr…
LeetCode – 203. Remove Linked List Elements
Remove all elements from a linked list of integers that have value val. Example Given: 1 –>…
LeetCode – 82. Remove Duplicates from Sorted List II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numb…
LeetCode – 83. Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once. For examp…
LeetCode – 48. Rotate Image
You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). …
LeetCode – 581. Shortest Unsorted Continuous Subarray
Given an integer array, you need to find one continuous subarray that if you only sort this subarray…