Program to check diagonal matrix and scalar matrix
Diagonal matrix: A square matrix is said to be diagonal matrix if the elements of matrix except main diagonal are zero. A square null matrix… Read More »
Diagonal matrix: A square matrix is said to be diagonal matrix if the elements of matrix except main diagonal are zero. A square null matrix… Read More »
Let A be a square matrix with all real number entries. Find two symmetric matrix P and skew symmetric matrix Q such that P +… Read More »
Given a matrix of size n*n. Count the frequency of given element k in that matrix. Here base index is 1. Examples: Input : n… Read More »
Given number of rows and columns. And given number of 1’s, 2’s, 3’s ……k’s which needs to be printed. Print them in a zig-zag way.… Read More »
Prerequisite – Resource Allocation Graph (RAG), Banker’s Algorithm, Program for Banker’s Algorithm Banker’s Algorithm is a resource allocation and deadlock avoidance algorithm. This algorithm test… Read More »
Given a matrix A and a matrix B, their Kronecker product C = A tensor B, also called their matrix direct product, is an matrix.… Read More »
If most of the elements in the matrix are zero then the matrix is called a sparse matrix. It is wasteful to store the zero… Read More »
Given a n x n matrix of integers. The problem is to find the largest area rectangular sub-matrix having sum divisible by the given value… Read More »
Given a binary matrix whose elements are only 0 and 1, we need to print the rows which are duplicate of rows which are already… Read More »
We are given two square matrices of same order. Check if two given matrices are identical. Examples: Input : A = [ [1, 1, 1,… Read More »
A new variety of rice has been brought in supermarket and being available for the first time, the quantity of this rice is limited. Each… Read More »
Given an n x n matrix and integer k. Find the k’th smallest element in the given 2D array. Examples: Input : mat = [[10,… Read More »
Given a binary matrix, print all unique rows of the given matrix. Order of row printing doesn’t matter. Examples: Input: mat = [[0, 1, 0,… Read More »
Given a N*M matrix A[][] representing a 3D figure. The height of the building at is . Find the surface area of the figure. Examples… Read More »
Given a boolean 2D array, where each row is sorted. Find the row with the maximum number of 1s. Examples: Example Input: matrix = [[0,… Read More »