Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Coding Interview University | 272,852 | a day ago | 57 | cc-by-sa-4.0 | ||||||
A complete computer science study plan to become a software engineer. | ||||||||||
Javascript Algorithms | 177,499 | 4 | 12 days ago | 4 | June 02, 2018 | 343 | mit | JavaScript | ||
📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings | ||||||||||
Fucking Algorithm | 120,626 | a month ago | 365 | Markdown | ||||||
刷算法全靠套路,认准 labuladong 就够了!English version supported! Crack LeetCode, not only how, but also why. | ||||||||||
Interviews | 60,220 | 4 months ago | 113 | mit | Java | |||||
Everything you need to know to get the job. | ||||||||||
Java | 54,980 | 11 hours ago | 207 | mit | Java | |||||
All Algorithms implemented in Java | ||||||||||
Leetcode | 52,867 | 15 days ago | 9 | other | JavaScript | |||||
LeetCode Solutions: A Record of My Problem Solving Journey.( leetcode题解,记录自己的leetcode解题之路。) | ||||||||||
Hello Algo | 52,619 | 17 hours ago | 20 | other | Java | |||||
《Hello 算法》:动画图解、一键运行的数据结构与算法教程,支持 Java, C++, Python, Go, JS, TS, C#, Swift, Rust, Dart, Zig 等语言。 | ||||||||||
Algorithm Visualizer | 45,235 | 18 days ago | 60 | mit | JavaScript | |||||
:fireworks:Interactive Online Platform that Visualizes Algorithms from Code | ||||||||||
Interview | 31,164 | 9 days ago | 23 | other | C++ | |||||
📚 C/C++ 技术面试基础知识总结,包括语言、程序库、数据结构、算法、系统、网络、链接装载库等知识及面试经验、招聘、内推等信息。This repository is a summary of the basic knowledge of recruiting job seekers and beginners in the direction of C/C++ technology, including language, program library, data structure, algorithm, system, network, link loading library, interview experience, recruitment, recommendation, etc. | ||||||||||
Javascript | 29,860 | a day ago | 83 | gpl-3.0 | JavaScript | |||||
Algorithms and Data Structures implemented in JavaScript for beginners, following best practices. |
Here you can find solutions for various coding/algorithmic problems and many useful resources for learning algorithms and data structures.
Also, this repo will be updated with new solutions and resources from time to time.
Note that this repo is meant to be used for learning and researching purposes only and it is not meant to be used for production.
Algorithms and data structures are not language-specific (it's true that some languages are faster, and some are easier to use), but if you are good with the logic and pseudocode, any language would be good.
So I've decided to use Python because I think it's very close to pseudocode and it's easily readable (so it'll be easy for someone from another environment to implement the same solutions).
As I said previously, all solutions are written in Python (more precisely, Python 3), using the Built-in Functions (print, len, range, sorted, sum, min, max, etc...) and a few modules from the Python Standard Library like:
So, to execute these solutions there is no need from installing any external packages.
Coding style and name conventions are described in the official PEP8 page.
Note that I'm not the author of these problems, they are from sites like LeetCode (you can find more than 40 sites like this in the Training Sites section). Only the solutions and explanations are mine. If you find any bug or incorrect implementation (or faster/better implementation) in this repo, please let me know by opening an issue or pull request.
For easier navigation into the solutions, each file with a solution in this repo will have the following template:
'''
Problem Name
Problem explanation.
Input: XXX
Output: XXX
Output explanation: XXX
=========================================
Solution 1 explanation.
Time Complexity: O(X)
Space Complexity: O(X)
Solution 2 explanation.
(some of the problems are solved in more than one way)
Time Complexity: O(X)
Space Complexity: O(X)
'''
##############
# Solution 1 #
##############
def name_of_solution_1(params):
# description of code
pass
##############
# Solution 2 #
##############
def name_of_solution_2(params):
# description of code
pass
###########
# Testing #
###########
# Test 1
# Correct result => 'result1'
test_val = 'example1'
print(name_of_solution_1(test_val))
print(name_of_solution_2(test_val))
# Test 2
# Correct result => 'result2'
test_val = 'example2'
print(name_of_solution_1(test_val))
print(name_of_solution_2(test_val))
Note that here I'm using the simplest way of testing, printing the results using the print method. Why? Because I think that the bigger part of the users of this repo isn't familiar with unit testing and I wanted this part to be intuitive. Btw, I strongly recommend using some unit testing framework for this kind of testing. The Python Standard Library contains a great framework for unit testing called unittest, or you can install some third-party unit testing framework like pytest.
Each solution/problem in this repo belongs to one of these categories:
The learning resources are divided into 4 categories: Courses, Books, Training Sites, Other Resources.
Collection of free courses from one of the best CS universities.
Stanford University
Princeton University
UC San Diego
MIT University
Harvard University
UC Berkeley
Several books that have made an impression on me:
If the problems from LeetCode are not enough and you need more problems like those, you can find much more on these platforms: