LintCode/LeetCode Summary
Introduction
Binary Search
Closest Number in Sorted Array
Last Position of Target
Maximum Number in Mountain Sequence
Search in a Big Sorted Array
Total Occurrence of Target
K Closest Numbers In Sorted Array
Smallest Rectangle Enclosing Black Pixels
Sqrt(x)
Sqrt(x) II
Search a 2D Matrix
Search a 2D Matrix II
Find Minimum in Rotated Sorted Array
Find Minimum in Rotated Sorted Array II
Find Peak Element
First Bad Version
Search in Rotated Sorted Array
Search in Rotated Sorted Array II
First Position of Target
Two Sum II - Input array is sorted
Valid Perfect Square
Find the Duplicate Number
Wood Cut
Binary Tree & Divide Conquer
Subtree with Maximum Average
Minimum Subtree
Lowest Common Ancestor III
Binary Tree Longest Consecutive Sequence
Binary Tree Path Sum
Lowest Common Ancestor II
Binary Tree Path Sum II
Binary Tree Longest Consecutive Sequence III
Binary Tree Longest Consecutive Sequence II
Binary Tree Maximum Path Sum II
Inorder Successor in Binary Search Tree
Convert Binary Search Tree to Doubly Linked List
Binary Tree Path Sum III
Sum Root to Leaf Numbers
Binary Tree Preorder Traversal
Binary Tree Inorder Traversal
Flatten Binary Tree to Linked List
Validate Binary Search Tree
BFS
Search Graph Nodes
Zombie in Matrix
Build Post Office II
Convert Binary Tree to Linked Lists by Depth
Six Degrees
Remove Substrings
Sequence Reconstruction
Connected Component in Undirected Graph
Smallest Rectangle Enclosing Black Pixels
Build Post Office
Number of Islands II
Pacific Atlantic Water Flow
01 Matrix
DFS
String Permutation
String Permutation II
Linked List & Array
Insert Into a Cyclic Sorted List
Maximum Subarray IV
Maximum Subarray V
Intersection of Two Arrays
Intersection of Two Arrays II
Copy List with Random Pointer
Linked List Cycle II
Reverse Linked List II
Remove Nth Node From End of List
Palindrome Linked List
Intersection of Two Linked Lists
Partition List
Reverse Nodes in k-Group
Best Time to Buy and Sell Stock
Best Time to Buy and Sell Stock II
Best Time to Buy and Sell Stock III
Subarray Sum Equals K
Two Pointers
Two Sum - Data structure design
Two Sum - Less than or equal to target
Two Sum - Unique pairs
Two Sum - Closest to target
Two Sum - Difference equals to target
Two Sum - Greater than target
Remove Duplicate Numbers in Array
Window Sum
Partition Array II
Kth Smallest Numbers in Unsorted Array
Triangle Count
3Sum
4Sum
4Sum II
Data Structure
High Five
K Closest Points
Kth Largest Element II
Top k Largest Numbers
strStr II
Flatten 2D Vector
Top k Largest Numbers II
Merge k Sorted Arrays
Top K Frequent Words
Implement Stack by Two Queues
Nested List Weight Sum
Zigzag Iterator II
Zigzag Iterator
Kth Smallest Element in a Sorted Matrix
Dynamic Programming
Knight Shortest Path
Knight Shortest Path II
Climbing Stairs II
Drop Eggs
Drop Eggs II
Powered by
GitBook
Two Pointers
指针用法
2根指针
相向而行:典型用法是排序后的Two Sum;Partition Array;
同向而行:慢指针作为checked指针,快指针作为先锋指针
3根指针
1根慢指针 + 2根相向而行:3 Sum
2根checked指针 + 1根先锋指针:Partition Array II, Sort Colors
results matching "
"
No results matching "
"