mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-23 09:38:27 +00:00
fix divide_and_conquer-folder
This commit is contained in:
parent
9547066cb9
commit
d90f331d19
@ -1,7 +1,7 @@
|
|||||||
from typing import List
|
from typing import List, Tuple
|
||||||
|
|
||||||
|
|
||||||
def max_difference(a: List[int]) -> (int, int):
|
def max_difference(a: List[int]) -> Tuple[int, int]:
|
||||||
"""
|
"""
|
||||||
We are given an array A[1..n] of integers, n >= 1. We want to
|
We are given an array A[1..n] of integers, n >= 1. We want to
|
||||||
find a pair of indices (i, j) such that
|
find a pair of indices (i, j) such that
|
||||||
|
@ -121,7 +121,7 @@ def strassen(matrix1: list, matrix2: list) -> list:
|
|||||||
dimension2 = matrix_dimensions(matrix2)
|
dimension2 = matrix_dimensions(matrix2)
|
||||||
|
|
||||||
if dimension1[0] == dimension1[1] and dimension2[0] == dimension2[1]:
|
if dimension1[0] == dimension1[1] and dimension2[0] == dimension2[1]:
|
||||||
return matrix1, matrix2
|
return [matrix1, matrix2]
|
||||||
|
|
||||||
maximum = max(max(dimension1), max(dimension2))
|
maximum = max(max(dimension1), max(dimension2))
|
||||||
maxim = int(math.pow(2, math.ceil(math.log2(maximum))))
|
maxim = int(math.pow(2, math.ceil(math.log2(maximum))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user