##
Maximum path sum in matrix
July 24, 2017

Given a matrix of N * M. Find the maximum path sum in matrix. The maximum path is sum of all elements from first row… Read More »

July 24, 2017

Given a matrix of N * M. Find the maximum path sum in matrix. The maximum path is sum of all elements from first row… Read More »

July 18, 2017

Image Compression : Image is stored or transmitted with having pixel value. It can be compressed by reducing the value its every pixel contains. Image… Read More »

July 15, 2017

We are given a row wise sorted matrix of size r*c, we need to find the median of the matrix given. It is assumed that… Read More »

July 5, 2017

Given a square matrix of order n*n, you have to interchange the elements of both diagonals. Examples: Input : matrix[][] = {1, 2, 3, 4,… Read More »

July 4, 2017

You are given a N*N matrix, where each element of matrix lies in the range 0 to M. You can apply the below operation on… Read More »

June 30, 2017

A magic square of order n is an arrangement of n^2 numbers, usually distinct integers, in a square, such that the n numbers in all… Read More »

June 28, 2017

Consider a N X N chessboard with a Queen and K obstacles. The Queen cannot pass through obstacles. Given the position (x, y) of Queen,… Read More »

June 26, 2017

Given two matrices A and B. The task is to multiply matrix A and matrix B recursively. If matrix A and matrix B are not… Read More »

June 19, 2017

Prerequisite – Multidimensional Arrays in C / C++ Given a two dimensional array, Write a program to print lower triangular matrix and upper triangular matrix.… Read More »

June 10, 2017

Given a 2D array, print it in reverse spiral form. We have already discussed Print a given matrix in spiral form. This article discusses how… Read More »

June 8, 2017

Given a rectangular grid of dimension 2 x n. We need to find out the maximum sum such that no two chosen numbers are adjacent,… Read More »

June 5, 2017

Given a n x n matrix. The problem is to find all the distinct elements common to all rows of the matrix. The elements can… Read More »

May 14, 2017

An element is a peak element if it is greater than or equal to its four neighbors, left, right, top and bottom. For example neighbors… Read More »

Given a sorted matrix mat[n][m] and an element ‘x’. Find position of x in the matrix if it is present, else print -1. Matrix is… Read More »

April 16, 2017

Given a matrix of n X n. The task is to calculate the absolute difference between the sums of its diagonal. Examples: Input : mat[][]… Read More »