mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
050b2a6e2c
* Update all_combinations.py The original implementation had limitations in handling edge cases and certain input parameters, leading to potential RecursionError. * Update all_combinations.py Added checks to handle cases where n or k are negative or where k is greater than n. In such scenarios, the function now returns an empty list, avoiding invalid recursive calls. * Update error handling Added checks to handle cases where `n` or `k` are negative or where `k` is greater than `n`. In such scenarios, the function now returns an empty list, avoiding invalid recursive calls. * Update backtracking/all_combinations.py * Update all_combinations.py --------- Co-authored-by: Christian Clauss <cclauss@me.com> |
||
---|---|---|
.. | ||
__init__.py | ||
all_combinations.py | ||
all_permutations.py | ||
all_subsequences.py | ||
coloring.py | ||
combination_sum.py | ||
crossword_puzzle_solver.py | ||
generate_parentheses.py | ||
hamiltonian_cycle.py | ||
knight_tour.py | ||
match_word_pattern.py | ||
minimax.py | ||
n_queens_math.py | ||
n_queens.py | ||
power_sum.py | ||
rat_in_maze.py | ||
README.md | ||
sudoku.py | ||
sum_of_subsets.py | ||
word_search.py |
Backtracking
Backtracking is a way to speed up the search process by removing candidates when they can't be the solution of a problem.