Print matrix elements using DFS traversal
Given a matrix grid[][] with dimension M Ã N of integers, the task is to print the matrix elements using DFS traversal. Examples: Input: mat[][] = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}}Output: 1 2 3 4 8 12 16 15 11 7 6 10 14 13 9 5Explanation: The matrix elements in the orde