Print All Diagonals of a given matrix by SJ · June 17, 2016 Objective: Given two dimensional matrix, write an algorithm to print all the diagonals of matrix. Example: Approach: We will solve this problem in two parts. first half of diagonals and second half of diagonals. See the code for more understanding, its self explanatory. Complete Code: Run This Code Output: 1 5 2 9 6 3 13 10 7 4 14 11 8 15 12 16 __________________________________________________ Top Companies Interview Questions..- Google Microsoft Amazon Facebook more.. If you find anything incorrect or you feel that there is any better approach to solve the above problem, please write comment. __________________________________________________ Related Posts:Maximum Subarray OR Largest Sum Contiguous Subarray Problem – Divide and ConquerTop 40 Interview Problems on ArraysGraph Implementation – Adjacency Matrix | Set 3Dynamic Programming – Count all paths in 2D Matrix with Obstructions in itFind longest Snake sequence in a given matrixDynamic Programming – Count all paths from top left to bottom right of a mXn matrixStock Single Sell Problem – O(n) SolutionMaximum difference between two elements where larger element appears after the…Dijkstra’s – Shortest Path Algorithm (SPT) – Adjacency Matrix – Java…Prim’s – Minimum Spanning Tree (MST) |using Adjacency MatrixShare this:LinkedInGooglePrintTumblrFacebookTwitterEmailRedditLike this:Like Loading...