Author: admin

Count Number of characters of the Character Array

“Count Number of characters of the character Array” is basically a problem of finding length of the character array. Here, we are given a character array and our task is to count the number of characters of the character array. The number of characters of the character array is same...

Reverse a String

“Reverse a String” is a basic operation which can be applied over string. Here, we are given a string of length ‘n’ and our task is to write a program to reverse the given string without using in-built function.  Example: INPUT: ABCDEFGH OUTPUT: HGFEDCBA There are multiple ways to reverse a...

Print Matrix in Spiral Order

“Print Matrix in Spiral Order” is a standard interview problem based on matrix data structure which have been asked in many technical and algorithmic interviews.  Here, we are given a matrix of size N*M and our task is to print the following matrix in spiral Order. Example: INPUT: N=3, M=3...

blank

Print Matrix in zig-zag order

“Print Matrix in zig-zag order” is a a problem of printing the given  matrix of size N*M in zig-zag order.  The zig-zag order of the matrix is traversing the first row of matrix from left to right, next row from right to left, next row from left to right and so...

blank

Sort the Matrix

“Sort the matrix” is a standard interview problem which has been asked in many technical and algorithmic interview. Here, we are given a matrix of size N*N. Our task is to write a program to sort the given matrix such that all the elements of all rows are sorted and...

blank

Check Idempotent Matrix

“Check Idempotent Matrix” is a problem of matrix where we need to check whether given matrix is an idempotent matrix or not. There are basically three different types of matrix: Identity Matrix: An identity matrix is a square matrix of size N*N which have all the diagonal element as 1 and...

blank

Check Involuntary Matrix

“Check Involuntary Matrix” is a basic problem of matrix where we need to check whether given matrix is an involuntary matrix or not. There are basically three different types of matrix: Identity Matrix: An identity matrix is a square matrix of size N*N which have all the diagonal element as 1...

blank

Check Identity Matrix

“Check Identity Matrix” is a problem of matrix, where we need to check whether given matrix is an identity matrix or not. There are basically three different types of matrix: Identity Matrix: An identity matrix is a square matrix of size N*N which have all the diagonal element as 1 and...

blank

Multiply Two Matrix

“Multiply two matrix” is a standard operation which can be applied over two or more matrices. Here, we are given two matrices of dimension r1*c1 and r2*c2 respectively. Our task is to multiply the following matrices and store the result in resultant matrix. CONDITION : The two matrices can only be added if the...

blank

Transpose of a Matrix

“Transpose of a matrix” is a basic problem on matrix where we interchange the row and columns with each other. Here, we are given a matrix of size N*M and our task is to find the transpose of the matrix by interchanging the row and columns. The resultant matrix will...