pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/TheAlgorithms/Python/commit/bc8df6de3143b417c4d174200fd7edd0dbba4ce3

s" /> [pre-commit.ci] pre-commit autoupdate (#11322) · TheAlgorithms/Python@bc8df6d · GitHub
Skip to content

Commit bc8df6d

Browse files
[pre-commit.ci] pre-commit autoupdate (#11322)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.2.2 → v0.3.2](astral-sh/ruff-pre-commit@v0.2.2...v0.3.2) - [github.com/pre-commit/mirrors-mypy: v1.8.0 → v1.9.0](pre-commit/mirrors-mypy@v1.8.0...v1.9.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 5f95d6f commit bc8df6d

297 files changed

Lines changed: 498 additions & 295 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
- id: auto-walrus
1717

1818
- repo: https://github.com/astral-sh/ruff-pre-commit
19-
rev: v0.2.2
19+
rev: v0.3.2
2020
hooks:
2121
- id: ruff
2222
- id: ruff-format
@@ -47,7 +47,7 @@ repos:
4747
- id: validate-pyproject
4848

4949
- repo: https://github.com/pre-commit/mirrors-mypy
50-
rev: v1.8.0
50+
rev: v1.9.0
5151
hooks:
5252
- id: mypy
5353
args:

backtracking/all_combinations.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"""
2-
In this problem, we want to determine all possible combinations of k
3-
numbers out of 1 ... n. We use backtracking to solve this problem.
2+
In this problem, we want to determine all possible combinations of k
3+
numbers out of 1 ... n. We use backtracking to solve this problem.
44
5-
Time complexity: O(C(n,k)) which is O(n choose k) = O((n!/(k! * (n - k)!))),
5+
Time complexity: O(C(n,k)) which is O(n choose k) = O((n!/(k! * (n - k)!))),
66
"""
7+
78
from __future__ import annotations
89

910
from itertools import combinations

backtracking/all_permutations.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
"""
2-
In this problem, we want to determine all possible permutations
3-
of the given sequence. We use backtracking to solve this problem.
2+
In this problem, we want to determine all possible permutations
3+
of the given sequence. We use backtracking to solve this problem.
44
5-
Time complexity: O(n! * n),
6-
where n denotes the length of the given sequence.
5+
Time complexity: O(n! * n),
6+
where n denotes the length of the given sequence.
77
"""
8+
89
from __future__ import annotations
910

1011

backtracking/all_subsequences.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Time complexity: O(2^n),
66
where n denotes the length of the given sequence.
77
"""
8+
89
from __future__ import annotations
910

1011
from typing import Any

backtracking/coloring.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""
2-
Graph Coloring also called "m coloring problem"
3-
consists of coloring a given graph with at most m colors
4-
such that no adjacent vertices are assigned the same color
2+
Graph Coloring also called "m coloring problem"
3+
consists of coloring a given graph with at most m colors
4+
such that no adjacent vertices are assigned the same color
55
6-
Wikipedia: https://en.wikipedia.org/wiki/Graph_coloring
6+
Wikipedia: https://en.wikipedia.org/wiki/Graph_coloring
77
"""
88

99

backtracking/hamiltonian_cycle.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""
2-
A Hamiltonian cycle (Hamiltonian circuit) is a graph cycle
3-
through a graph that visits each node exactly once.
4-
Determining whether such paths and cycles exist in graphs
5-
is the 'Hamiltonian path problem', which is NP-complete.
2+
A Hamiltonian cycle (Hamiltonian circuit) is a graph cycle
3+
through a graph that visits each node exactly once.
4+
Determining whether such paths and cycles exist in graphs
5+
is the 'Hamiltonian path problem', which is NP-complete.
66
7-
Wikipedia: https://en.wikipedia.org/wiki/Hamiltonian_path
7+
Wikipedia: https://en.wikipedia.org/wiki/Hamiltonian_path
88
"""
99

1010

backtracking/minimax.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
leaves of game tree is stored in scores[]
88
height is maximum height of Game tree
99
"""
10+
1011
from __future__ import annotations
1112

1213
import math

backtracking/n_queens.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
"""
22
3-
The nqueens problem is of placing N queens on a N * N
4-
chess board such that no queen can attack any other queens placed
5-
on that chess board.
6-
This means that one queen cannot have any other queen on its horizontal, vertical and
7-
diagonal lines.
3+
The nqueens problem is of placing N queens on a N * N
4+
chess board such that no queen can attack any other queens placed
5+
on that chess board.
6+
This means that one queen cannot have any other queen on its horizontal, vertical and
7+
diagonal lines.
88
99
"""
10+
1011
from __future__ import annotations
1112

1213
solution = []

backtracking/n_queens_math.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
for another one or vice versa.
7676
7777
"""
78+
7879
from __future__ import annotations
7980

8081

backtracking/sudoku.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
have solved the puzzle. else, we backtrack and place another number
1010
in that cell and repeat this process.
1111
"""
12+
1213
from __future__ import annotations
1314

1415
Matrix = list[list[int]]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy