All Projects → recnac-itna → Algorithm_templates

recnac-itna / Algorithm_templates

Licence: mit
algorithm templates and leetcode examples in Python3, you can learn many python tricks too.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Algorithm templates

Leetcode Solutions
🏋️ Python / Modern C++ Solutions of All 2111 LeetCode Problems (Weekly Update)
Stars: ✭ 2,787 (+2504.67%)
Mutual labels:  algorithm, data-structure, leetcode
Apachecn Algo Zh
ApacheCN 数据结构与算法译文集
Stars: ✭ 10,498 (+9711.21%)
Mutual labels:  algorithm, data-structure, leetcode
Algorithm
The challenges for algorithm contests, and summary the implementation.
Stars: ✭ 115 (+7.48%)
Mutual labels:  algorithm, data-structure, leetcode
Leetcode
High-quality LeetCode solutions
Stars: ✭ 178 (+66.36%)
Mutual labels:  algorithm, data-structure, leetcode
Competitive Programing
个人算法刷题处
Stars: ✭ 33 (-69.16%)
Mutual labels:  algorithm, leetcode
Algorithm Visualizer
🎆Interactive Online Platform that Visualizes Algorithms from Code
Stars: ✭ 35,995 (+33540.19%)
Mutual labels:  algorithm, data-structure
Awesome Competitive Programming
💎 A curated list of awesome Competitive Programming, Algorithm and Data Structure resources
Stars: ✭ 9,119 (+8422.43%)
Mutual labels:  algorithm, data-structure
Data Structure And Algorithms
A complete and efficient guide for Data Structure and Algorithms.
Stars: ✭ 48 (-55.14%)
Mutual labels:  algorithm, data-structure
Algorithm
Algorithm is a library of tools that is used to create intelligent applications.
Stars: ✭ 787 (+635.51%)
Mutual labels:  algorithm, data-structure
Algorithmmap
建立你的算法地图:如何高效学习算法;算法工程师:从小白到专家
Stars: ✭ 47 (-56.07%)
Mutual labels:  algorithm, leetcode
Awesome Java Leetcode
👑 LeetCode of algorithms with java solution(updating).
Stars: ✭ 8,297 (+7654.21%)
Mutual labels:  algorithm, leetcode
Lintcode
📜 Lintcode/Leetcode algorithm written by Java, Python and JavaScript.
Stars: ✭ 21 (-80.37%)
Mutual labels:  algorithm, leetcode
100 Days Of Ios Datastructure Algorithm
100天iOS数据结构与算法实战
Stars: ✭ 836 (+681.31%)
Mutual labels:  algorithm, leetcode
Awesome Algorithm Question Solution
LeetCode,《剑指offer》中的算法题的题目和解法以及常见算法的实现
Stars: ✭ 988 (+823.36%)
Mutual labels:  algorithm, leetcode
Vscode Leetcode
Solve LeetCode problems in VS Code
Stars: ✭ 6,982 (+6425.23%)
Mutual labels:  algorithm, leetcode
Leetcode
正确的姿势,学习的态度来刷 LeetCode:高效的代码、简洁的注释、精炼的总结。
Stars: ✭ 1,043 (+874.77%)
Mutual labels:  algorithm, leetcode
Leetcode Solutions
LeetCode Solutions in Objective - C or Swift. At least one question every day
Stars: ✭ 70 (-34.58%)
Mutual labels:  algorithm, leetcode
Usaco
General Resources for Competitive Programming
Stars: ✭ 1,152 (+976.64%)
Mutual labels:  algorithm, data-structure
Blog
Life is a moment 📔
Stars: ✭ 1,236 (+1055.14%)
Mutual labels:  algorithm, data-structure
Leetcode
JavaScript AC solutions to problems on LeetCode
Stars: ✭ 100 (-6.54%)
Mutual labels:  algorithm, leetcode

Algorithm Templates

Description

Templates and examples in Python3, including common data structure & algorithms.

I have collected and summarized general code templates for particular algorithms, and add most typical examples to help make better use of it. All the examples come from LeetCode, and I have attached the problem id and brief description.

"Stop Trying to Reinvent the Wheel"

So I try my best to find the commonality in problems, solutions and codes. When I study, I have summarized templates for future use.

First I intended to use it for myself, and now I realize maybe it is good enough to share with people who also need it.

Supplementary explanation

  1. It is written in Python3, but easy to extend to other languages, such as Java, C++. Just replace the python syntactic sugar and advanced tricks, maybe just less concise.

  2. With my limited time and ability, here only covers common data structure & algorithms. Almost suitable for interview, but insufficient for competition.

  3. I have tried my best to collect and summarize the most general and best-practice templates in particular area, but this version may not be the best solution. Or, it's really the best performance and most concise solution, but it's not the suitable for you. Within acceptable performance, it is the best practice for you when you use it most conveniently.

  4. Code templates is written by python with some pseudo code, so I use self and add stub functions to pass compiler's check. You should replace them with your particular logic according to the comments.

Why Python?

"life is short, you need python"

With the help of Python's advanced features, it can let us ignore redundant grammar, and totally focus on algorithm and logic.

Besides, it is popular, and I'm the big fan of this language myself.

Who is this for?

  1. If you will have interviews soon, and plan to review data structure & algorithm. You can review by these summary, and improve practical skills by typical examples.
  2. If you want to study algorithm by practice, here you can understand the key point in templates, and practice the examples from easy to hard, to understand it deeper.
  3. If you are a LeetCoder, you want to focus on your weak topics, and have no idea to which problems to solve, here is well classified and provides the most typical examples. Or, you are too tired to find a fastest and elegant answer in discussion, here can save your time.
  4. If you are a python beginner, and want to enhance your advanced pythonic skills, you can focus on python tricks. Hope you will find useful and elegant techniques here.

Thanks to

  • Thanks to all good problems from LeetCode. In addition, LeetCode has a great OJ platform, and really suitable to do functional and performance test.
  • Many templates and tricks are enlightened by discussions in LeetCode, thanks to all the code masters.
  • Special thanks to Stefan Pochmann, really learned a lot from him.

MIT License

Feel free to use, copy, modify, merge or publish. just add a reference, please.

If it helps you or you like it, you can star or share it. thanks : )

I'm glad if you want to contribute to make it better.

Reference

Generalization Discussions scraping from LeetCode

I scrape the most popular discussions and filter the ones which summarized a general approach to particular domain, such as backtracking, dynamic programming, sliding window, bit manipulation.

Well worth reading:

Contact

[email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].