Personal repository for data structures and algorithm solutions in LeetCode.
Table of contents
Due to the amount of topics found in LeetCode, problems can be found in the following categories:
- array
- binary search
- binary tree
- bit manipulation
- dynamic programming
- graph search
- linked list
- matrix
- numbers
- permutation and combination
- regex
- stack
- string
- trie
Evaluating time and space complexity of solutions
LeetCode uses a statistical system of time and space evaluation that is different of other pages like HackerRank, and this system also varies on the language that you use: A Java solution will be compared against other Java solutions and so on. The complexity required in the problem will give you a hint of what is required for the overall solution:
,
are the easiest to identify
- For
, will typically be a binary search or related problem
will be merge sort or divide-and-conquer
for factorials
can be identified if the result set happens to scale like a binary pattern, like backtracking or permutations in general
Cracking the Coding Interview has such a good section on time/space complexities and how to figure them out.
Dependencies
This repo was created using Python 3 and PyCharm IDE.
Check the project here.