Skip to content

Commit 05e5172

Browse files
qckzrpoyea
authored andcommitted
.vs/ directory, matrix_multiplication_addition file and binary tree directory (TheAlgorithms#894)
* Added print function into matrix_multiplication_addition.py and removed blank space in data_structures/binary tree directory * Removed .vs/ folder per TheAlgorithms#893 * Rename matrix_multiplication_addition.py to matrix_operation.py
1 parent 066f374 commit 05e5172

File tree

9 files changed

+8
-7
lines changed

9 files changed

+8
-7
lines changed

.vs/Python/v15/.suo

-16.5 KB
Binary file not shown.

.vs/slnx.sqlite

-172 KB
Binary file not shown.
File renamed without changes.

matrix/matrix_multiplication_addition.py matrix/matrix_operation.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import print_function
2+
13
def add(matrix_a, matrix_b):
24
rows = len(matrix_a)
35
columns = len(matrix_a[0])
@@ -63,13 +65,12 @@ def main():
6365
matrix_b = [[3, 4], [7, 4]]
6466
matrix_c = [[11, 12, 13, 14], [21, 22, 23, 24], [31, 32, 33, 34], [41, 42, 43, 44]]
6567
matrix_d = [[3, 0, 2], [2, 0, -2], [0, 1, 1]]
66-
67-
print(add(matrix_a, matrix_b))
68-
print(multiply(matrix_a, matrix_b))
69-
print(identity(5))
70-
print(minor(matrix_c , 1 , 2))
71-
print(determinant(matrix_b))
72-
print(inverse(matrix_d))
68+
print('Add Operation, %s + %s = %s \n' %(matrix_a, matrix_b, (add(matrix_a, matrix_b))))
69+
print('Multiply Operation, %s * %s = %s \n' %(matrix_a, matrix_b, multiply(matrix_a, matrix_b)))
70+
print('Identity: %s \n' %identity(5))
71+
print('Minor of %s = %s \n' %(matrix_c, minor(matrix_c , 1 , 2)))
72+
print('Determinant of %s = %s \n' %(matrix_b, determinant(matrix_b)))
73+
print('Inverse of %s = %s\n'%(matrix_d, inverse(matrix_d)))
7374

7475
if __name__ == '__main__':
7576
main()

0 commit comments

Comments
 (0)