Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+7 votes

I quite don't understand what is the difference between major and minor diagonal so cannot come up with a good way to get a list of diagonals.

asked in CSC201 Spring 2021 by (8 points)
+1

A major diagonal starts at the top left and finished at the bottom right. A minor diagonal starts sat the top right and finishes at the bottom left.

1 Answer

+5 votes

The minor diagonal is top right to bottom left, while the major diagonal is top left to bottom right. So if you have a 3 x 3 table:

XOO
OXO
OOX

The Xs are along the major diagonal above.

OOX
OXO
XOO

The Xs are now along the minor diagonal.

answered by (337 points)
+1

Got it. Thanks a lot

...