/LintCode

📜 Lintcode/Leetcode algorithm written by Java, Python and JavaScript. https://kexin-li.github.io/LintCode

Primary LanguagePython

LintCode

LintCode/LeetCode algorithm written by Java, Python and JavaScript.

阅读更多算法文章: https://kexin-li.github.io/LintCode

Table of Contents

Sort

# Problem Solution Keywords
1 Bubble Sort JavaScript, Python3 冒泡排序
2 Insert Sort JavaScript, Python3 插入排序
3 Select Sort JavaScript, Python3 选择排序
4 Merge Sort JavaScript, Python3 归并排序
5 Quick Sort JavaScript Python3 快速排序
排序算法总结 Summary

Binary Search

# Problem Solution Keywords
1 Classical Binary Search JavaScript, Java, Python3 标准二分
2 Maximum Number in Mountain Sequence JavaScript, Java
3 Last Position of Target JavaScript, Java
4 First Position of Target JavaScript
5 Find First and Last Position of Element in Sorted Array JavaScript
6 K Closest Numbers In Sorted Array JavaScript, Java 二分法+双指针 💡
7 Search in a Big Sorted Array JavaScript, Java 倍增法
8 Find Minimum in Rotated Sorted Array JavaScript, Java 💡
9 Find Peak Element JavaScript, Java
10 First Bad Version Java
11 Search in Rotated Sorted Array JavaScript, Java
12 Recover Rotated Sorted Array Java
13 Pow(x, n) Java 快速幂算法
14 Fast Power TODO
15 Find Minimum in Rotated Sorted Array II TODO
16 Median of Two Sorted Arrays TODO
17 Find the Duplicate Number TODO
二分法总结 Summary

Two Pointer

# Problem Solution Keywords
1 Two Sum JavaScript, Java, Python3 HashMap
2 Valid Palindrome JavaScript, Java 标准双指针 💡
3 Valid Palindrome II Java
4 deduplication Java
5 Window Sum Java
6 Two Sum - Difference equals to target Java
7 Linked List Cycle Java
8 Quick Sort JavaScript, Java 快速排序
9 Merge Sort JavaScript, Java 归并排序
10 Kth Largest Element Java Top K
11 Sort Colors JavaScript, Java, Python3 三指针 💡
12 Move Zeros JavaScript, Java
13 Partition Array Java
14 3 Sum Java
双指针算法总结 Summary

Linked List

# Problem Solution Keywords
1 Delete Node in a Linked List JavaScript, Python3
2 Reverse Linked List JavaScript, Python3
3 Reverse Linked List II Python3
4 Linked List Cycle JavaScript, Python3
5 Merge Two Sorted List JavaScript, Python3
6 Remove Duplicates from Sorted List JavaScript, Python3
7 Intersection of Two Linked Lists Python3
8 Remove Linked List Elements JavaScript, Python3
9 Palindrome Linked List Python3
10 Middle of the Linked List Python3
11 Design Linked List Python3
12 Add Two Numbers Python3
13 Add Two Numbers II Python3
14 Split Linked List in Parts Python3
15 Rotate List Python3
16 Reorder List Python3
17 Remove Nth Node From End of List Python3
Linked List 算法总结 Summary

BFS

# Problem Solution Keywords
1 Binary Tree Level Order Traversal Java, Python3
2 Number of Islands Java, Python3
3 Topological Sorting Java 拓扑排序
4 Word Ladder Java BFS+HashSet
5 Surrounded Regions Java, Python3
6 Shortest Path in Undirected Graph Java 双向宽搜
BFS 算法总结 Summary

DFS

# Problem Solution Keywords
1 Maximum Depth of Binary Tree Java, Python3, JavaScript 遍历/分治
2 Balanced Binary Tree Java 分治法
3 Validate Binary Search Tree Java, JavaScript 遍历/分治
4 Closest Binary Search Tree Value Java, JavaScript 二分
5 Minimum Subtree Java 遍历+分治
6 Triangle Java 分治+记忆搜索
7 Combinations Java 组合
DFS 算法总结 Summary

Array

# Problem Solution Keywords
1 Maximum Subarray Java, JavaScript, Python3 前缀和
2 Median of two Sorted Arrays Python3
3 Implement Stack by Two Queues Java
4 Single Number JavaScript, Python3
5 Move Zeros JavaScript, Python3
6 Find All Numbers Disappeared in an Array JavaScript, Python3
7 Majority Element JavaScript, Python3
8 Reshape the Matrix Python3
9 Flipping an Image JavaScript, Python3
10 Array Partition I JavaScript, Python3
11 Transpose Matrix Python3
12 Toeplitz Matrix Python3
13 Monotonic Array JavaScript, Python3
14 Max Consecutive Ones JavaScript, Python3
15 Max Area of Island Python3
16 Fair Candy Swap Python3
17 Contains Duplicate Python3
18 Two Sum II - Input array is sorted JavaScript, Python3 HashMap, Binary Search
19 1-bit and 2-bit Characters Python3
20 Best Time to Buy and Sell Stock II Python3
21 Degree of an Array Python3
22 Positions of Large Groups Python3
23 Missing Number Python3
24 Maximum Product of Three Numbers Python3
25 Jewels and Stones JavaScript
26 Min Cost Climbing Stairs Python3
27 Longest Continuous Increasing Subsequence Python3
28 Pascal's Triangle Python3
29 Remove Element Python3
30 Peak Index in a Mountain Array JavaScript Binary Search
31 Sort Array By Parity Python3
32 Search a 2D Matrix JavaScript, Python3
Array 算法总结 Summary

String

# Problem Solution Keywords
1 First Unique Character in a String Java, Python3
2 Reverse Words in a String JavaScript
3 Reverse Words in a String II Python3
4 Reverse String JavaScript
5 Valid Anagram JavaScript
6 Rotate String Java, Python3 部分逆序
7 Palindrome Number JavaScript, Python3
8 Valid Parenthesis String Python3
String 算法总结 Summary

DP

# Problem Solution Keywords
1 Minimum Path Sum Java, Python3 坐标型
2 Unique Paths Java, Python3 坐标型
3 Unique Paths II Java, Python3 坐标型
4 Fibonacci Python3 斐波那契
5 Climbing Stairs Java, Python3 斐波那契变体
6 Jump Game Python3
7 Triangle Python3
8 Longest Increasing Subsequence Java, Python3 序列型
9 Longest Common Subsequence Java, Python3 序列型
10 Longest Continuous Increasing Subsequence Python3
11 Edit Distance Java 序列型
12 Paint Fence Python3
13 Range Sum Query Python3
14 Interleaving String Python3
15 Maximum Subarray Python3
动态规划算法总结 Summary

Binary Tree

# Problem Solution Keywords
1 Merge Two Binary Trees JavaScript
2 Binary Tree Preorder Traversal JavaScript, Python3 迭代: stack + array
3 Binary Tree Inorder Traversal JavaScript, Python3 迭代: stack + array
4 Binary Tree Postorder Traversal Python3
5 Construct Binary Tree from Preorder and Inorder Traversal JavaScript, Python3
6 Binary Tree Level Order Traversal JavaScript, Python3
7 Binary Tree Level Order Traversal II Python3
8 Binary Tree Zigzag Level order Traversal Python3
9 Maximum Depth of Binary Tree Python3
10 Balanced Binary Tree Python3
11 Search in a Binary Search Tree JavaScript 尾递归
Binary Tree 总结 Summary