![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
双指针法
Ber03
:)
展开
-
[LeetCode] 344. Reverse String
原题链接:https://leetcode.com/problems/reverse-string/1. 题目介绍Write a function that reverses a string. The input string is given as an array of characters char[].Do not allocate extra space for another ...原创 2019-03-20 12:03:39 · 115 阅读 · 0 评论 -
[LeetCode] 80. Remove Duplicates from Sorted Array II
原题链接:https://leetcode.com/problems/remove-element/1. 题目介绍Given an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate extra space for a...原创 2019-07-25 23:05:55 · 135 阅读 · 0 评论 -
[LeetCode] 11. Container With Most Water
原题链接:1. 题目介绍2. 解题思路原创 2019-07-21 17:36:22 · 173 阅读 · 0 评论 -
[LeetCode] 283. Move Zeroes
原题链接:https://leetcode.com/problems/move-zeroes/1. 题目介绍Given an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the non-zero elements.给出一个数组nums...原创 2019-07-24 22:04:24 · 121 阅读 · 0 评论 -
[LeetCode] 876. Middle of the Linked List
原题链接: https://leetcode.com/problems/middle-of-the-linked-list/1. 题目介绍Given a non-empty, singly linked list with head node head, return a middle node of linked list. If there are two middle nodes, re...原创 2019-04-24 22:12:49 · 150 阅读 · 0 评论 -
[LeetCode] 234. Palindrome Linked List
原题链接: https://leetcode.com/problems/palindrome-linked-list/1. 题目介绍Given a singly linked list, determine if it is a palindrome.判断一个链表是不是回文串。Example 1:Input: 1->2Output: falseExample 2:Input...原创 2019-04-19 20:02:24 · 135 阅读 · 0 评论 -
[LeetCode] 160. Intersection of Two Linked Lists
原题链接: https://leetcode.com/problems/intersection-of-two-linked-lists/1. 题目介绍Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following t...原创 2019-04-18 22:25:51 · 135 阅读 · 0 评论 -
[LeetCode] 109. Convert Sorted List to Binary Search Tree
原题链接: https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/1. 题目介绍Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.For...原创 2019-04-14 22:33:46 · 141 阅读 · 0 评论 -
[LeetCode] 143. Reorder List
原题链接: https://leetcode.com/problems/reorder-list/1. 题目介绍Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You may not modify the values in the list’s nodes, only ...原创 2019-04-13 23:26:43 · 147 阅读 · 0 评论 -
[LeetCode] 328. Odd Even Linked List
原题链接: https://leetcode.com/problems/odd-even-linked-list/1. 题目介绍Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node nu...原创 2019-04-21 01:11:14 · 104 阅读 · 0 评论 -
[LeetCode] 142. Linked List Cycle II
原题链接:https://leetcode.com/problems/linked-list-cycle-ii/1. 题目介绍Given a linked list, return the node where the cycle begins. If there is no cycle, return null.To represent a cycle in the given linke...原创 2019-04-13 00:24:13 · 106 阅读 · 0 评论 -
[LeetCode] 148. Sort List
原题链接: https://leetcode.com/problems/sort-list/1. 题目介绍Sort a linked list in O(n log n) time using constant space complexity.使用常数级的空间复杂度 和 O(n log n) 的时间复杂度为一个链表排序。Example 1:Input: 4->2->1-&g...原创 2019-04-15 22:20:38 · 131 阅读 · 0 评论 -
[LeetCode] 82. Remove Duplicates from Sorted List II
原题链接: https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/原创 2019-04-07 00:48:42 · 110 阅读 · 0 评论 -
[LeetCode] 141. Linked List Cycle
原题链接: https://leetcode.com/problems/linked-list-cycle/1. 题目介绍Given a linked list, determine if it has a cycle in it.To represent a cycle in the given linked list, we use an integer pos which repres...原创 2019-04-05 23:01:32 · 388 阅读 · 0 评论 -
[LeetCode] 19. Remove Nth Node From End of List
原题链接: https://leetcode.com/problems/remove-nth-node-from-end-of-list/1. 题目介绍Given a linked list, remove the n-th node from the end of list and return its head.给定一个链表,删除倒数第 n 个元素,然后返回新链表的头指针Example...原创 2019-03-29 17:07:33 · 195 阅读 · 0 评论 -
[LeetCode] 27. Remove Element
原题链接:https://leetcode.com/problems/remove-element/1. 题目介绍Given an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate extra space for a...原创 2019-03-25 23:22:02 · 92 阅读 · 0 评论 -
[LeetCode] 3. Longest Substring Without Repeating Characters
原题链接: https://leetcode.com/problems/longest-substring-without-repeating-characters/1. 题目介绍Given a string, find the length of the longest substring without repeating characters.给出1个字符串,寻找没有重复字母的最长子串...原创 2019-03-22 21:32:46 · 86 阅读 · 0 评论 -
[LeetCode] 26. Remove Duplicates from Sorted Array
原题链接: https://leetcode.com/problems/remove-duplicates-from-sorted-array/1. 题目介绍Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new le...原创 2019-03-17 22:17:25 · 132 阅读 · 0 评论 -
[LeetCode] 28. Implement strStr()
原题链接:原创 2019-07-26 16:44:20 · 142 阅读 · 0 评论