Lesson 17 of 34

2D Arrays: Matrix2D Arrays: Matrices

10 min 30 XP

2D array என்பது rows மற்றும் columns உள்ள அட்டவணை. m[row][col] என்று அணுகலாம். m.length rows எண்ணிக்கை, m[0].length columns எண்ணிக்கை.

A 2D array is a table with rows and columns, accessed as m[row][col]. m.length is the number of rows and m[0].length the number of columns.

Example: edit me and press Run

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.

Transpose: m[r][c]-ஐ t[c][r]-ல் வைக்கவும். Matrix கேள்விகளில் இது அடிக்கடி கேட்கப்படும்.

Transpose: put m[r][c] into t[c][r]. A popular matrix interview question.

Challenge

+30 XP

r மற்றும் c (rows, columns), பிறகு matrix-ஐப் படித்து, ஒவ்வொரு row-ன் கூட்டுத்தொகையையும் தனி வரியில் print செய்யுங்கள். Input: 2 3 1 2 3 4 5 6 Output: 6 15

Read r and c (rows and columns), then the matrix. Print the sum of each row on its own line. Input: 2 3 1 2 3 4 5 6 Output: 6 15

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.