Explore tens of thousands of sets crafted by our community.
Algorithm Design Paradigms
4
Flashcards
0/4
Divide and Conquer
This paradigm involves dividing a problem into smaller subproblems, solving those subproblems independently, and then combining their solutions to solve the original problem. Example: Merge Sort.
Dynamic Programming
A method for solving complex problems by breaking them down into simpler subproblems, solving each of these subproblems just once, and storing their solutions - typically using a memory-based data structure (array, map, etc.). Example: Fibonacci sequence calculation.
Greedy Algorithm
A heuristic that makes the locally optimal choice at each stage with the hope of finding a global optimum. Example: Dijkstra's algorithm for shortest paths.
Backtracking
This paradigm is used for finding all (or some) solutions to some computational problems, notably constraint satisfaction problems, that incrementally build candidates to the solutions, and abandons a candidate ('backtracks') as soon as it determines that this candidate cannot possibly be completed to a valid solution. Example: The N-Queens problem.
© Hypatia.Tech. 2024 All rights reserved.