Backtracking Algorithms Flashcards

1
Q

Backtracking Algorithms

A

Backtracking is a technique for solving problems by exploring all possible solutions and removing those that do not satisfy the problem constraints. Examples include solving the N-Queens Problem and Sudoku Solver.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

N-Queens Problem

A

The N-Queens Problem is a classic puzzle that involves placing N chess queens on an N×N chessboard so that no two queens threaten each other. In other words, no two queens can share the same row, column, or diagonal. Solving this problem requires finding all possible solutions or configurations of queens on the board that satisfy these constraints.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Sudoku Solver

A

The Sudoku Solver is an algorithmic problem that involves filling a 9×9 grid with digits (usually from 1 to 9) so that each column, each row, and each of the nine 3×3 subgrids (called “regions” or “boxes”) contain all of the digits without repetition. Solving this problem entails finding a valid solution for the partially filled grid.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Combination Sum

A

The Combination Sum problem involves finding all possible combinations of numbers in an array that add up to a specific target sum. It may involve using each number in the array multiple times or only once, depending on the variant of the problem. Backtracking is often used to find these combinations efficiently.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly