All Projects → MTrajK → Coding Problems

MTrajK / Coding Problems

Licence: mit
Solutions for various coding/algorithmic problems and many useful resources for learning algorithms and data structures

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Coding Problems

Leetcode In Swift
My solutions to LeetCode problems written in Swift
Stars: ✭ 150 (-93.25%)
Mutual labels:  algorithms, data-structures, interview, leetcode
C
Collection of various algorithms in mathematics, machine learning, computer science, physics, etc implemented in C for educational purposes.
Stars: ✭ 11,897 (+435.66%)
Mutual labels:  algorithms, data-structures, education, interview
Leetcode Python
Leetcode Python Solution and Explanation. Also a Guide to Prepare for Software Engineer Interview.
Stars: ✭ 1,088 (-51.01%)
Mutual labels:  algorithms, data-structures, interview, leetcode
Fuck Coding Interviews
How on earth can I ever think of a solution like that in an interview?!
Stars: ✭ 464 (-79.11%)
Mutual labels:  algorithms, data-structures, interview, leetcode
Rust Algorithms
Common data structures and algorithms in Rust
Stars: ✭ 2,918 (+31.38%)
Mutual labels:  algorithms, data-structures, education, learn
Algorithms Leetcode Javascript
Algorithms resolution in Javascript. Leetcode - Geeksforgeeks - Careercup
Stars: ✭ 157 (-92.93%)
Mutual labels:  algorithms, data-structures, interview, leetcode
Leetcode
😖 😕 😃LeetCode问题解题思路。
Stars: ✭ 130 (-94.15%)
Mutual labels:  algorithms, data-structures, interview, leetcode
Interviewguide
《大厂面试指北》——包括Java基础、JVM、数据库、mysql、redis、计算机网络、算法、数据结构、操作系统、设计模式、系统设计、框架原理。最佳阅读地址:http://notfound9.github.io/interviewGuide/
Stars: ✭ 3,117 (+40.34%)
Mutual labels:  algorithms, data-structures, interview, leetcode
Leetcode 101
LeetCode 101:和你一起你轻松刷题(C++)
Stars: ✭ 5,327 (+139.85%)
Mutual labels:  algorithms, data-structures, interview, leetcode
Algorithms And Data Structures In Java
Algorithms and Data Structures in Java
Stars: ✭ 498 (-77.58%)
Mutual labels:  algorithms, data-structures, interview, leetcode
Leetcode Patterns
A curated list of leetcode questions grouped by their common patterns
Stars: ✭ 3,750 (+68.84%)
Mutual labels:  algorithms, data-structures, leetcode
Complete Placement Preparation
This repository consists of all the material required for cracking the coding rounds and technical interviews during placements.
Stars: ✭ 1,114 (-49.84%)
Mutual labels:  algorithms, data-structures, interview
Leetcode
👏🏻 leetcode solutions for Humans™
Stars: ✭ 1,129 (-49.17%)
Mutual labels:  algorithms, interview, leetcode
Ready For Tech Interview
💻 신입 개발자로서 준비를 하기 위해 지식을 정리하는 공간 👨‍💻
Stars: ✭ 1,035 (-53.4%)
Mutual labels:  algorithms, data-structures, interview
Go
Algorithms Implemented in GoLang
Stars: ✭ 7,385 (+232.51%)
Mutual labels:  algorithms, data-structures, interview
Leetcode
My Python Solutions for Leetcode
Stars: ✭ 80 (-96.4%)
Mutual labels:  algorithms, data-structures, interview
Algorithmic Pseudocode
This repository contains the pseudocode(pdf) of various algorithms and data structures necessary for Interview Preparation and Competitive Coding
Stars: ✭ 519 (-76.63%)
Mutual labels:  algorithms, data-structures, leetcode
Technical Interview Guide
My learning material for technical interviews!
Stars: ✭ 76 (-96.58%)
Mutual labels:  algorithms, data-structures, interview
Leetcode Sol Res
Clean, Understandable Solutions and Resources for LeetCode Online Judge Algorithm Problems.
Stars: ✭ 1,647 (-25.84%)
Mutual labels:  algorithms, interview, leetcode
Competitive Programming
Hello Programmers 💻 , A one-stop Destination✏️✏️ for all your Competitive Programming Resources.📗📕 Refer CONTRIBUTING.md for contributions
Stars: ✭ 113 (-94.91%)
Mutual labels:  algorithms, data-structures, leetcode

Coding Problems

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.

Solutions

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.

Template

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.

Categories

Each solution/problem in this repo belongs to one of these categories:

  1. Arrays - Array Manipulations, Sorting, Binary Search, Divide and Conquer, Sliding Window, etc.
  2. Linked Lists - Linked List Searching, Pointer Manipulations, etc.
  3. Trees - Binary Search Trees, Tree Traversals: Breadth-First (Level Order) Traversal, Depth-First Traversal (Inorder, Preorder, Postorder), etc.
  4. Hashing DS - Hashing Data Structures: Sets/HashSets and Dictionaries/HashMaps.
  5. Dynamic Programming - 2D and 1D Dynamic Programming, LCS, LIS, Knapsack, etc.
  6. Strings - String Manipulations, Reversing, Encodings/Decodings, etc.
  7. Math - GCD, LCM, Factorization, Geometry, Math Formulas, etc.
  8. Other - Backtracking, BFS, DFS, Stacks, Queues, Deques, Priority Queues (Heaps), Matrices, etc.

Learning Resources

The learning resources are divided into 4 categories: Courses, Books, Training Sites, Other Resources.

Courses

Collection of free courses from one of the best CS universities.

  1. Stanford University

  2. Princeton University

  3. UC San Diego

  4. MIT University

  5. Harvard University

  6. UC Berkeley

Books

Several books that have made an impression on me:

  1. Grokking Algorithms by Aditya Bhargava - The best book for complete beginners in algorithms! I wish this book existed when I started learning algorithms.
  2. Introduction to Algorithms by CLRS - This book is called the "bible textbook of algorithms" by many programmers.
  3. Algorithms by Robert Sedgewick & Kevin Wayne - These authors are instructors of the previously mentioned Coursera courses: Algorithms Part 1 and Algorithms Part 2. Also, this book has an excellent and free site with exercises, presentations, and examples.
  4. The Algorithm Design Manual by Steven Skiena - The book describes many advanced topics and algorithms and it focuses on real-life practical examples. This book has one of the best sites with resources (solutions, algorithms and data structures, python implementations).
  5. Algorithms by S. Dasgupta, C. Papadimitriou, and U. Vazirani - This book is an official book for algorithms and data structures classes in several famous universities.
  6. Competitive Programming 3 by Steven Halim & Felix Halim - A great book that prepares you for competitive programming (not for complete beginners). You can learn many things and tricks about competitive programming. But if your goal is to prepare for competitive programming then choose a faster language than Python, C/C++ (or Java, it's faster than Python but not like C/C++).
  7. Cracking the Coding Interview by Gayle Laakmann McDowell - A bit different from the previous books. Prepares you for coding interviews using great coding problems.

Training Sites

If the problems from LeetCode are not enough and you need more problems like those, you can find much more on these platforms:

Other Resources

  1. Geeks For Geeks - The site which all interested in algorithms (no matter if beginners or experts) should know! YouTube channel with many useful videos.
  2. The Algorithms - Python - Great GitHub repo with many algorithms written in Python (Link from the same repo written in other programming languages).
  3. CP Algorithms - Great page with excellent explanations for various algorithms.
  4. Visualizers:
    • USFCA Visualization Tool - Great tool for visualizing data structures and algorithms, created by the University of San Francisco.
    • VisuAlgo - Another great tool for visualizing data structures and algorithms through animation.
    • Algorithm Visualizer - Interactive online platform that visualizes algorithms from code. This platform is an open-source project, here you can find the source code.
  5. Courses and tutorials (but not from universities like the Courses section):
  6. YouTube playlists with tutorials:
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].