Category: data structure

Count Number of Vowels and Consonants in the String

“Count Number of Vowels and Consonants in the String ” is a basic problem of string data structure. Here, we are given a string of length ‘n’ and our task is to count the number of vowels and consonants present in the string. Example: Input: Help12me!@study#bro Output: The number of...

Count Frequency of Character in String

“Count Frequency of Character in String” is a basic problem of string data structure. Here, we are given a string of length ‘n’ and our task is to write a program to count how many times a particular character occurs in the string. Example: Input:  Enter a string: abcdrfedsdfddgr Enter...

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...

blank

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...

blank

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...