# Category Archives: Matrix (adsbygoogle = window.adsbygoogle || []).push({});

## Count number of ways to reach destination in a Maze using BFS

Given a maze with obstacles, count number of paths to reach rightmost-bottom most cell from the topmost-leftmost cell. A cell in the given maze has… Read More »

## Number of shortest paths to reach every cell from bottom-left cell in the grid

Given two number N and M. The task is to find the number of shortest paths to reach the cell(i, j) in the grid of… Read More »

## Find the number of p-sided squares in a grid with K blacks painted

Given a grid of size H*W with all cells initially white. Given N pairs (i, j) in an array, for each pair, paint cell (i,… Read More »

## Find the number of cells in the table contains X

Given two integer N and X. N represents the number of rows and columns of a table. And the element at the ith row and… Read More »

## Find the sum of elements of the Matrix generated by the given rules

Given three integers A, B and R, the task is to find the sum of all the elements of the matrix generated by the given… Read More »

## Count number of ways to reach destination in a maze

Given a maze of 0 and -1 cells, the task is to find all the paths from (0, 0) to (n-1, m-1), and every path… Read More »

## Print a given matrix in spiral form using direction tracking method

Given a 2-D matrix mat[][], the task is to print it in the spiral form. Examples: Input: mat[][] = { {1, 2, 3, 4}, {5,… Read More »

## Rat in a Maze Problem when movement in all possible directions is allowed

Consider a rat placed at (0, 0) in a square matrix m[ ][ ] of order n and has to reach the destination at (n-1,… Read More »

## Minimum number of steps to convert a given matrix into Diagonally Dominant Matrix

Given a matrix of order NxN, the task is to find the minimum number of steps to convert given matrix into Diagonally Dominant Matrix. In… Read More »

## Find the position of the given row in a 2-D array

Given a matrix mat[][] of size m * n which is sorted in row-wise fashion and an array row[], the task is to check if… Read More »

## Find the number of paths of length K in a directed graph

Given a directed, unweighted graph with N vertices and an integer K. The task is to find the number of paths of length K for… Read More »

## Minimum time required to rot all oranges | Dynamic Programming

Given a matrix of dimension m * n where each cell in the matrix can have values 0, 1 or 2 which has the following… Read More »

## Find the sum of Eigen Values of the given N*N matrix

Given an N*N matrix mat[][], the task is to find the sum of Eigen values of the given matrix. Examples: Input: mat[][] = { {2,… Read More »

## Minimum steps required to convert the matrix into lower hessenberg matrix

Given a matrix of order NxN, Find the minimum number of steps to convert given matrix into Lower Hessenberg matrix. In each step, the only… Read More »

## Minimum number of steps to convert a given matrix into Upper Hessenberg matrix

Given a matrix of order NxN, Find the minimum number of steps to convert given matrix into Upper Hessenberg matrix. In each step, the only… Read More »