Operations with matrices – Matrix Class in c ++

Original matrix
17 16 10 26
10 3 9 19
29 7 1 6
6 20 0 10

Auxiliary matrix at the beginning
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0

Auxiliary matrix after comparisons
with the number of repetitions of the values
1 1 3 1
3 1 1 1
1 1 1 2
2 1 1 3
The fashion of the matrix is: 10,
3 is the maximum value that is repeated in the matrix
And in the positions where 3 is found, 10 is found in the original matrix.

A tip that the teacher gave me is to reduce the number of comparisons by creating a Boolean matrix and putting a few and zeroes in the numbers that I have already compared and then not comparing again with the numbers that I compared previously. I will continue solving the problem, if someone has another solution and can explain it fantastic.

You may also like...

1 Response

  1. 2017

    […] Previous story Operations with matrices – Matrix Class in c ++ […]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

error: Content is protected !!