Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Java 

Don't really understand how matrix's work

Prepare a matrix codes that picks a row (it does not necessarily have to be the first row), moves it to the top of the matrix, and turns the first number into a 1, using only the three allowed matrix operations. (Don't forget, you cannot turn a 0 into a 1, but any other number is fair game.)

I am doing my homework assignment and really don't understand the logic behind it. If anyone can help me with this I would appreciate it. It really doesn't have to be a full working code.
Here's the logic behind it.

1) Start with some matrix (I will be using the following 3x3 matrix):
int[][] matrix:
3 5 6
9 2 4
9 4 6

2) Pick any row to be moved to the top (I'll be using row 2):
3 5 6 => 9 2 4
9 2 4 => 3 5 6
9 4 6 => 9 4 6

3) Check if first number is != 0, change to 1 (9 != 0):
1 2 4
3 5 6
9 4 6

What are the matrix operations you're allowed to use?
as sharp as a spoon
Matrix is simply a 2D array.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by Sir BillyAug 26, 2019 06:33 PM 1 149 Aug 26, 2019 06:33 PM
Last Post: YouthInAsia
[Java] by DimleadOct 13, 2018 10:17 AM 5 398 Oct 13, 2018 10:17 AM
Last Post: SaefkoTeam
[Java] by ComputroniumApr 11, 2018 09:48 AM 3 209 Apr 11, 2018 09:48 AM
Last Post: Computronium