Matrix Data Structure
Last Updated :
07 Nov, 2024
Improve
Matrix Data Structure is a two-dimensional array arranged in rows and columns. It is commonly used to represent mathematical matrices and is fundamental in various fields like mathematics, computer graphics, and data processing. Matrices allow for efficient storage and manipulation of data in a structured format.

Basics of Matrix Data Structure
- Representation and Basic Operations
- Row-wise vs column-wise traversal
- Applications of Matrix Data Structure
Basic Problems
- Search in a Matrix
- Addition of Matrices
- Subtraction of Matrices
- Multiplication of Matrices
- Sort the given matrix
- Search in a sorted matrix
- Traverse Matrix using Recursion
- Transpose of a matrix
- Determinant of a Matrix
- Adjoint and Inverse of a Matrix
Easy Problems
- The Celebrity Problem
- Print matrix in zag-zag
- Rotate Matrix Elements by 1
- Scalar multiplication of a matrix
- Print Matrix in Spiral
- Max in Each Row
- Distinct Common Elements in Rows
- Unique in a matrix
- Shift matrix elements row-wise by k
- Swap major and minor diagonals
- Squares of Matrix Diagonal Elements
- Sum of middle row and column in Matrix
- Program to check idempotent matrix
- Program to check diagonal matrix and scalar matrix
- Identity Matrix
- Mirror across diagonal
Medium Problems
- Conway’s Game Of Life
- Rotate a matrix by 90
- Check if all rows are circular rotations
- Given a matrix of ‘O’ and ‘X’, find the largest subsquare surrounded by ‘X’
- Maximum size square sub-matrix with all 1s
- Count zeros in a row wise and column wise sorted matrix
- Queries in a Matrix
- Pairs with given sum such that elements of pair are in different rows
- Find all permuted rows of a given row in a matrix
- Find number of transformation to make two Matrix Equal
- Inplace (Fixed space) M x N size matrix transpose
- Minimum flip required to make Binary Matrix symmetric
- Magic Square
Hard Problems
- Find the number of islands
- A Boolean Matrix Question
- Matrix Chain Multiplication
- Maximum size rectangle binary sub-matrix with all 1s
- Construct Ancestor Matrix from a Given Binary Tree
- Print K’th element in spiral form of matrix
- Find size of the largest ‘+’ formed by all ones in a binary matrix
- Shortest path in a Binary Maze
- Print maximum sum square sub-matrix of given size
- Validity of a given Tic-Tac-Toe board configuration
- Minimum Initial Points to Reach Destination
- Strassen’s Matrix Multiplication
- Maximum sum rectangle in a 2D matrix
- Program for Sudoku Generator
Quick Links:
Recommended:


