Giter VIP home page Giter VIP logo

algorithms-with-illustrations's Introduction


Aogrithms with Illustration

Aogrithms with Illustration

When you understand something, then you can find the math to express that understanding. The math doesn't provide the understanding. The purpose of computing is insight, not numbers. The only real valuable thing is intuition.

by Leslie Lamport & Richard Hamming & Albert Einstein

Features

  • Insight: intuition, connect, debug
  • Core: basics, application, best practice, typical problems, explanation, Q&A
  • Map: problem type -> (data structure, design techniques) -> ways of thinking

Lists

source: wiki

Every field of science has its own problems and needs efficient algorithms. Related problems in one field are often studied together.

Fields tend to overlap with each other, and algorithm advances in one field may improve those of other, sometimes completely unrelated, fields. For example, dynamic programming was invented for optimization of resource consumption in industry but is now used in solving a broad range of problems in many fields.

Field Algorithms
Combinatorial/3 General combinatorial, Graph, Sequence
/general
/graph/5 Graph drawing, Network theory, Routing for graphs, Graph search, Subgraphs
//basics coloring, Hopcroft–Karp, Hungarian, Prüfer coding, Tarjan's, topological-sort
//drawing
//network theory
//routing MST(Borůvka, prim, kruskal, Reverse-delete)
//search
//subgraph
/sequence/9 matching, selection, search, merge, permutations, alignment, sorting, subsequences, substrings
//sorting quicksort, mergesort, insertion-sort, heap-sort, counting-sort, selection-sort
//selection quickselect, introselect, median of medians
//permutations Fisher–Yates,
//substrings Longest common substring, substring search(Aho–Corasick, Boyer–Moore, KMP, Rabin–Karp, Zhu–Takaoka), Ukkonen-suffix-tree, matching wildcards
Computational Math/ Computer algebra, Geometry, Number theoretic algorithms, Numerical algorithms, Optimization
/Optimization ...dynamic programming...
//-dynamic programming string (longest common subsequence, longest increasing subsequence, longest common substring, edit distance), Kadane-maximum-subarray,
graph (Viterbi, Floyd, TSP, Bellman–Ford),
pseudo-polynomial time(subset sum, knapsack, partition),
interval scheduling
Computational science
...

data structrue

list of data structures

  • binary/bit, string, array(hash), linked list, queue, stack
  • set: disjoint set
  • graph
  • tree: binary tree, binary search tree, heap, trie, binary indexed tree, segment tree
  • sequence, hash
key 🔑 typical problems👻 video/gif 🎦 notes 📒
Data Structure⛓️ 🌟举一(Typical)

反三
(👾easy, 👻medium, 👹hard)
data structure mindmap
逻辑结构
存储结构
操作方式
Bit 🌟268. Missing Number

👾371 sum, 👻260 single, 411 unique
bit
String 🌟12. Integer to Roman

👾67 add,👻6 zigzag, 336 palindrome系列
string anagram
palindrome
KMP⚡️
Array 🌟75. Sort Colors

👾26 duplicate, 👻31 permute, 41 missing
array
off-by-1,
from the back
matrix
Hash 🌟325. Maximum Size Subarray Sum Equals k 系列

👾1 sum系列, 👻49 group, 149 points
hash
by Inside python dict
Linked List 🌟25. Reverse Nodes in k-Group

👾141 cycle, 👻2 add, 👹146 LRU
linkedlist 加删查转
虚头虚尾
快慢指针
Queue 849?

👻346 stream, ?, 363 rectangle
queue FIFO
+BFS
Stack 🌟84. Largest Rectangle in Histogram系列

👾20 parentheses系列, 👻394 decode, 👹770 calculator系列
stack

LIFO
+DFS
最近最大
存做后用
离散有序
Set
Disjoint Set 🌟305. Number of Islands II

x, 👻130 regions, 👹803 falling
disjoint set / union-find
by Union Find
Graph graph
Tree? 261. Graph Valid Tree

tree insert
delete
change
cycle
search
Binary Tree 🌟105. Construct BT from Preorder and Inorder Traversal系列

👾617 merge系列, 👻199 view系列, 👹124 path-sum系列
binary tree recursive
操作
查看
计算
Binary Search Tree 🌟230. Kth Smallest Element in a BST

👾108 convert, 👻173 iterator, 99 recover
binary search tree 中序遍历
Heap 🌟407. Trapping Rain Water II

👾743 delay, 👻215 kth, 👹857 workers
trapping-rain-water-2-heap from https://youtu.be/cJayBq38VYw
407
LIBO
+Greedy
Trie? 🌟212. Word Search II

👾720 longest,👻421 XOR,👹642 autocomplete
trie

design technique

  • DFS, BFS
  • Divide & conquer, DP, Greedy
  • Binary search,Decrease & conquer,Dynamic & conquer
key 🔑 typical problems👻 video/gif 🎦 notes 📒
算法**❤️ algorithms insight ❤️❤️
DFS 🌟46. Permutations

👾112 Path系列, 👻105. Construct, 👹329. topological
DFS
探测环
前序遍历
非递归
拓扑排序
树深
DFS with Memo 913
BFS 🌟490.The Maze系列

👾107 level, 👻200 island, 👹269 alien
bfs 遍历

最短路径
拓扑排序
Divide & conquer 🌟23. Merge k Sorted Lists

👾53 Maximum, 👻932 Beautiful, 👹4 Median
divide and conquer mergesort
DP 🌟Stock系列

👾70 stairs, 👻416 subset, 👹140 words
dynamic programming
by Pramp
choice
variable
sequence
最短路径(TSP)
for/recursive
counting
string
DP2DFS
背包416
股票系列
Greedy 🌟402. Remove K Digits系列

👾455 cookies, 👻253 rooms, 👹135 candy
greedy
minimum coins
Heap
Prim
Kruskal
归纳
演绎
Transform & conquer Transform & conquer / heap sort heap sort
Decrease & conquer 🌟240. Search a 2D Matrix II

169 majority, 78 subsets, 👹4 median
decrease and conquer / insertion sort
by Anany
减一技术
binary search
size-decrease
Binary Search 🌟33. Search in Rotated Sorted Array

👾35 insert, 👻300 longest, 👹354 envelopes
binary search 减治系列
搜索系列
  • Induction & Deduction
  • Recursion, Backtracking
  • Two pointer, Siding window, Fast and slow
  • Reverse thinking, Complement
key 🔑 typical problems👻 video/gif 🎦 notes 📒
思维方式🤔️ 🤔️🤔️🤔️🤔️🤔️🤔️🤔️🤔️🤔️🤔️ 🤔️🤔️🤔️🤔️🤔️ 🤔️🤔️
Recursion? 🌟894. All Possible Full Binary Trees

👾687 longest, 698 subsets, 248 strobogrammatic系列
recursion +hashmap
递归公式
终止条件
Backtracking 39. Combination Sum

401 watch, 22 parentheses, 51 n-queens
backtracking 集合
数迷
递归求解
触底反弹
Two Pointers 🌟18. 4Sum

👾344 reverse 👻 11 container, 632 range
two pointers
Sliding Window 🌟159. Longest Substring with At Most Two Distinct Characters

👾26 remove, 👻19 node, 👹76 substring
sliding window
满足自省
fast and slow 287. Find the Duplicate Number

283 move zeros,142,?
fast&slow pointers 快慢指针
Reverse thinking 88, 795, 777, 👹803 reverse thinking
Complement 🌟930.Binary Subarrays With Sum

👾283 move, 👻921 add, 👹?
complement
930

Tools

Search:

Visualize:

  • DS Visualizations
  • Pythontutor: visualize Python, Java, JavaScript, C, C++, Ruby code execution
  • Graph: create the graph from the adjacency list
  • imagus: enlarge images from links with a mouse hover
  • Visualizer: an interactive online platform that viualizes algorithms from code.
  • codelike: given most animated view of data structures like binary tree, binary search tree, avl tree, red black tree, linked list and so on.
  • mind-palace

Language:

  • Python: A Python module for learning all major algorithms
  • Java: 算法4精华笔记,通俗理解
  • Javascript: Implemented in JavaScript with explanations and links to further readings
  • Multi: Algorithm and data structure implementations in Python, C, C++ and Java

Practice:

  • 50+: give you enough of an idea of the kinds of questions you can expect in a real programming job interview
  • Leetcode: Practice real interview questions
  • Pramp: Mock Interview

Thanks

  • @caomingkai
  • @davidxkHeapg

algorithms-with-illustrations's People

Contributors

willwangcc avatar

Stargazers

Dinesh.S avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.