- Grokking Algorithms: An illustrated guide for programmers and other curious people
Concepts
- Brute Force - look at all the possibilities and selects the best solution
- Greedy - choose the best option at the current time, without any consideration for the future
- Divide and Conquer - divide the problem into smaller parts and then solve those parts
- dynamic-programming - build up a solution using previously found sub-solutions
- Backtracking - similarly to brute force, try to generate all possible
solutions, but each time you generate next solution you test if it satisfies
all conditions, and only then continue generating subsequent solutions.
Otherwise, backtrack, and go on a different path of finding a solution.
Normally the DFS traversal of state-space is being used
- Branch & Bound - remember the lowest-cost solution found at each stage of
the backtracking search, and use the cost of the lowest-cost solution found
so far as a lower bound on the cost of a least-cost solution to the problem,
in order to discard partial solutions with costs larger than the lowest-cost
solution found so far. Normally BFS traversal in combination with DFS
traversal of state-space tree is being used
Graph theory
Resources