C/Visual C - ARRAYS.

 
Vista:
sin imagen de perfil

ARRAYS.

Publicado por DALSOM (1 intervención) el 08/04/2005 17:24:24
Hey guys, hello again, sorry by this in english, i just pasted the text from other forum to avoid rewrite it again.

Hello, i have a matriz that is composed from others more matriz. The final matriz on X or Y can be from 0 to
K; the K, in this case is 3 for columns or Y, and for the rows or X's is 3, and X and Y obey
the formula L=n(K)+(0=<a<K) where n and K must be more than 0,and can vary in each case. In this case,
n=1, K =3 , a=1 for the X's
n=1, K =3 , a=2 for the Y's

And, i have in other matriz the values of critical points : X=[3,6,7] Y=[3,5] . then your start point
will be the point P(1,5) and your finish point P(7,1).

1 2 3 4 5 6 7

1 |7 8 9| |16 17 18| |21|
2 |4 5 6| |13 14 15| |20|
3 |1 2 3| |10 11 12| |19|

4 |25 26 27| |31 32 33| |35|
5 |22 23 24| |28 29 30| |34|

sorted in this lineal matriz
A=|1,2,3,4,...,35|

and i want to sort to this order

Aº=|22,23,24,28,29,30,34,25,26,27,31,32,...,17,18,21|

To do this, i need a formula that say me the exact position of the start point in the matriz A, of any of its points, letting me reorder
the A matriz into Aº matriz.

How would be that equation.

Thanks a lot for try to help me.

Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder