Programming / design patterns

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/12

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

13 Terms

1
New cards

Dynamic Programming

Solving complex problems → Breaking down into simpler OVERLAPPING subproblems → Storing the solutions to avoid redundant work

EX: Fib with memory

2
New cards

Brute Force

Tries all possible solutions to find the best answer → inefficient for large inputs

3
New cards

Divide and Conquer

Breaking a problem into smaller sub problems → solving each independently and then combining there answers

4
New cards

Guess and Check

Trial and error method → tests some possibilities until a solution is found

5
New cards

Backtracking

Exploring all possible solutions → using constraints/bounds to eliminate options

6
New cards

Recursion

Calling the function itself to solve a problem

7
New cards

Heuristic

A practical method that isnt guaranteed to be perfect or optimal but is enough to reach an immediate goal

8
New cards

Branch and Bound

Exploring all possible solutions and using bounds to eliminate a large subset of unpromising solutions

9
New cards

Greedy Algorithm

Making a series of choice of what looks best at the moment and not looking back

10
New cards

Singleton Design Pattern

Ensures that theres only 1 instance → global point of access for it.

11
New cards

Decorator Design Pattern

Pattern used to change the behavior of a class without changing behavior of other classes

EX: pizza extends pizzaDecorator

12
New cards

Marker Design Pattern

Used to indicate that a class implements a specific interface or has specific properties without defining methods.

EX: Cloneable, Serializable

13
New cards

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.}

Explore top flashcards