# Thread: Table elements compare...

1. ## Table elements compare...

Hey! I am happy i joined your great community

I have a problem, and hope someone can help me.

I have a table NxM dimension - A.

I have to find in A dominate lines, otherwords - I have to find in A any line that has each element smaller than for ex the elements from [k] line.

I mean Line [i] is dominated if there is line [k] and for any [j] we have A[i][j]<A[k][j]. When i find dominated lines- i have to delete them from A.

for ex:
A=

1 | 1 5 6 7|
2 | 2 1 9 0|
3 | 8 3 1 4|
4 | 7 1 0 2|

here line [4] is smaller than line [3],
line [4] is dominated , and i delete it.

I need your help in composing an algorithm.
Going to write it in C++.
Hope that somebody will propose an algorithm.
I became mad....can't compose...

2. Well a function to compare rows i and j of a given matrix would be a useful start.

Like
bool result = isDominant( A, i, j );

A function which returns true or false, depending on the rule you've outlined.

Popular pages Recent additions