# algo-learn
学习数据结构与算法的代码示例,目前提供 Java、Python、Go 支持(C++ 也慢慢开始了)。维护这个 Repository 的目的有两个:
* 编程是一门实践的艺术,多多练习,多多思考,把这里列举的所有算法、数据结构,以及对应的常见 leetcode 习题都自己手敲几遍,增强自己的**编码基本功**,写出高质量的代码。
* 同时也给刷题的朋友一些指导,面对 Leetcode 上千道题目,可能会觉得手足无措,想刷题但是又不知道从哪里开始。
这里记录的是我自己的刷题过程,基本上都是一些 easy 和 medium 的题目,并且分类详细,你可以参考这个顺序,然后有针对性的去刷题。
这些题目在面试中也是比较高频的,**应对大多数面试**已经是绰绰有余了。
**Repo 逐步完善中,欢迎补充更多题目,以及贡献代码!**
## 数组
* 实现一个动态扩容的数组【[Java](https://github.com/roseduan/algo-learn/blob/master/java/datastructure/array/GenericArray.java)、[Python](https://github.com/roseduan/algo-learn/blob/master/python/array/array.py)、[Go](https://github.com/roseduan/algo-learn/blob/master/go/array/array.go)】
* 常见 leetcode 练习题:
| 题号 | 题目名称 | 解题代码 | 难度 |
| :------: | :----------------------------------------------------------: | :----------------------------------------------------------: | :------: |
| 1 | [两数之和](https://leetcode-cn.com/problems/two-sum/) | [Java](https://github.com/roseduan/algo-learn/blob/master/java/datastructure/array/leetcode/TwoSum.java)、[Python](https://github.com/roseduan/algo-learn/blob/master/python/array/leetcode/two_sum.py)、[Go](https://github.com/roseduan/algo-learn/blob/master/go/array/leetcode/two_sum.go)、[C++](https://github.com/roseduan/algo-learn/blob/master/cpp/array/two_sum.cpp) | 简单 |
| 283 | [移动零](https://leetcode-cn.com/problems/move-zeroes/) | [Java](https://github.com/roseduan/algo-learn/blob/master/java/datastructure/array/leetcode/MoveZero.java)、[Python](https://github.com/roseduan/algo-learn/blob/master/python/array/leetcode/move_zero.py)、[Go](https://github.com/roseduan/algo-learn/blob/master/go/array/leetcode/move_zero.go)、[C++](https://github.com/roseduan/algo-learn/blob/master/cpp/array/move_zeros.cpp) | 简单 |
| 217 | [存在重复元素](https://leetcode-cn.com/problems/contains-duplicate/) | [Java](https://github.com/roseduan/algo-learn/blob/master/java/datastructure/array/leetcode/ContainsDuplicate.java)、[Python](https://github.com/roseduan/algo-learn/blob/master/python/array/leetcode/contains_duplicate.py)、[Go](https://github.com/roseduan/algo-learn/blob/master/go/array/leetcode/contains_duplicate.go)、[C++](https://github.com/roseduan/algo-learn/blob/master/cpp/array/%20contains_duplicate.cpp) | 简单 |
| 219 | [存在重复元素 II](https://leetcode-cn.com/problems/contains-duplicate-ii/) | [Java](https://github.com/roseduan/algo-learn/blob/master/java/datastructure/array/leetcode/ContainsDuplicateII.java)、[Python](https://github.com/roseduan/algo-learn/blob/master/python/array/leetcode/contains_duplicate_ii.py)、[Go](https://github.com/roseduan/algo-learn/blob/master/go/array/leetcode/contains_duplicate_ii.go)、[C++](https://github.com/roseduan/algo-learn/blob/master/cpp/array/contains_duplicate_ii.cpp) | 简单 |
| 66 | [加一](https://leetcode-cn.com/problems/plus-one/) | [Java](https://github.com/roseduan/algo-learn/blob/master/java/datastructure/array/leetcode/PlusOne.java)、[Python](https://github.com/roseduan/algo-learn/blob/master/python/array/leetcode/plus_one.py)、[Go](https://github.com/roseduan/algo-learn/blob/master/go/array/leetcode/plus_one.go)、[C++](https://github.com/roseduan/algo-learn/blob/master/cpp/array/plus_one.cpp) | 简单 |
| 136 | [只出现一次的数字](https://leetcode-cn.com/problems/single-number/) | [Java](https://github.com/roseduan/algo-learn/blob/master/java/datastructure/array/leetcode/SingleNumber.java)、[Python](https://github.com/roseduan/algo-learn/blob/master/python/array/leetcode/single_number.py)、[Go](https://github.com/roseduan/algo-learn/blob/master/go/array/leetcode/single_number.go)、[C++](https://github.com/roseduan/algo-learn/blob/master/cpp/array/single_number.cpp) | 简单 |
| 121 | [买卖股票的最佳时机 I](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/) | [Java](https://github.com/roseduan/algo-learn/blob/master/java/datastructure/array/leetcode/BestTimeBuySellStock.java)、[Python](https://github.com/roseduan/algo-learn/blob/master/python/array/leetcode/best_time_buy_sell_stock.py)、[Go](https://github.com/roseduan/algo-learn/blob/master/go/array/leetcode/best_time_buy_sell_stock.go) | 简单 |
| 122 | [买卖股票的最佳时机 II](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-ii/) | [Java](https://github.com/roseduan/algo-learn/blob/master/java/datastructure/array/leetcode/BestTimeBuySellStockII.java)、[Python](https://github.com/roseduan/algo-learn/blob/master/python/array/leetcode/best_time_buy_sell_stock_ii.py)、[Go](https://github.com/roseduan/algo-learn/blob/master/go/array/leetcode/best_time_buy_sell_stock_ii.go) | 简单 |
| 88 | [合并两个有序数组](https://leetcode-cn.com/problems/merge-sorted-array/) | [Java](https://github.com/roseduan/algo-learn/blob/master/java/datastructure/array/leetcode/MergeSortedArray.java)、[Python](https://github.com/roseduan/algo-learn/blob/master/python/array/leetcode/merge_sorted_array.py)、[Go](https://github.com/roseduan/algo-learn/blob/master/go/array/leetcode/merge_sorted_array.go)、[C++](https://github.com/roseduan/algo-learn/blob/master/cpp/array/merge_sorted_array.cpp) | 简单 |
| 26 | [删除排序数组中的重复项](https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/) | [Java](https://github.com/roseduan/algo-learn/blob/master/java/datastructure/array/leetcode/RemoveDuplicates.java)、[Python](https://github.com/roseduan/algo-learn/blob/master/python/array/leetcode/remove_deulicates.py)、[Go](https://github.com/roseduan/algo-learn/blob/master/go/array/leetcode/remove_duplicate.go)、[C++](https://github.com/roseduan/algo-learn/blob/master/cpp/array/remove_duplicates.cpp) | 简单 |
| 118 | [杨辉三角](https://leetcode-cn.com/problems/pascals-triangle/) | [Java](https://github.com/roseduan/algo-learn/blob/master/java/datastructure/array/leetcode/PascalsTriangle.java)、[Python](https://github.com/roseduan/algo-learn/blob/master/python/array/leetcode/pascals_triangle.py)、[Go](https://github.com/roseduan/algo-learn/blob/master/go/array/leetcode/pascals_triangle.go)、[C++](https://github.com/roseduan/algo-learn/blob/master/cpp/array/pascals_triangle.cpp) | 简单 |
| 169 | [多数元素](https://leetcode-cn.com/problems/majority-element/) | [Java](https://github.com/roseduan/algo-learn/blob/master/java/datastructure/array/leetcode/MajorityElement.java)、[Python](https://github.com/roseduan/algo-learn/blob/master/python/array/leetcode/majority_element.py)、[Go](https://github.com/roseduan/algo-learn/blob/master/go/array/leetcode/majority_element.go)、[C++](https://github.com/roseduan/algo-learn/blob/master/cpp/array/majority_element.cpp) | 简单 |
| 15 | [三数之和](https://leetcode-cn.com/problems/3sum/) | [Java](https://github.com/roseduan/algo-learn/blob/master/java/datastructure/array/leetcode/ThreeSum.java)、[Python](https://github.com/roseduan/algo-learn/blob/master/python/array/leetcode/three_sum.py)、[Go](https://github.com/roseduan/algo-learn/blob/master/go/array/leetcode/three_sum.go)、[C++](https://github.com/roseduan/algo-le