Matrix | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Matrix

can you help me. what program that can search a matrix

4th Dec 2016, 8:58 AM
Markjoseph Bataller
Markjoseph Bataller - avatar
3 Answers
+ 3
you can do one, with 2 loops (one for columns, other for rows.. It will look something like that: int desiredNumber; for(int i=0;i<matrix[0].length;i++){ for(int j=0;i<matrix[1].length;i++){ if (matrix[i;j0]==desiredNumber){ return true;} } } return false;
4th Dec 2016, 9:04 AM
Nahuel
Nahuel - avatar
0
do you means arrays
4th Dec 2016, 5:24 PM
يوسف عبدالرحمن يوسف
يوسف عبدالرحمن يوسف - avatar
0
yes
5th Dec 2016, 1:18 PM
Markjoseph Bataller
Markjoseph Bataller - avatar