1/12
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
Dynamic Programming
Solving complex problems → Breaking down into simpler OVERLAPPING subproblems → Storing the solutions to avoid redundant work
EX: Fib with memory
Brute Force
Tries all possible solutions to find the best answer → inefficient for large inputs
Divide and Conquer
Breaking a problem into smaller sub problems → solving each independently and then combining there answers
Guess and Check
Trial and error method → tests some possibilities until a solution is found
Backtracking
Exploring all possible solutions → using constraints/bounds to eliminate options
Recursion
Calling the function itself to solve a problem
Heuristic
A practical method that isnt guaranteed to be perfect or optimal but is enough to reach an immediate goal
Branch and Bound
Exploring all possible solutions and using bounds to eliminate a large subset of unpromising solutions
Greedy Algorithm
Making a series of choice of what looks best at the moment and not looking back
Singleton Design Pattern
Ensures that theres only 1 instance → global point of access for it.
Decorator Design Pattern
Pattern used to change the behavior of a class without changing behavior of other classes
EX: pizza extends pizzaDecorator
Marker Design Pattern
Used to indicate that a class implements a specific interface or has specific properties without defining methods.
EX: Cloneable, Serializable
Iterator Design Pattern
A way to access the information within the class without exposing underlying representation
EX: class someClass implements Iterable<>
public boolean hasNext() {}
// moves the cursor/iterator to next element
public T next() {}
// Used to remove an element. Implement only if needed
public void remove() { // Default throws UnsupportedOperationException.}