# Category Archives: Arrays

Insertion sort is a simple sorting algorithm that works similar to the way you sort playing cards in your hands. The array is virtually split… Read More
The below program checks if two square matrices of size 4*4 are identical or not. For any two matrices to be equal, the number of… Read More
Given a 2D array, sort each row of this array and print the result.Examples:  Input: 77 11 22 3 11 89 1 12 32 11… Read More
Transpose of a matrix is obtained by changing rows to columns and columns to rows. In other words, transpose of A[][] is obtained by changing… Read More
Given a 4 x 4 matrix, the task is to interchange the elements of first and last columns and show the resulting matrix.Examples:   Input: 8… Read More
Given an array arr[] of size N, the task is to find the maximum sum of a subset of the array such that the sum… Read More
Given an array arr[] of size N consisting only of 0s and 1s, the task is to find the minimum number of operations required to… Read More
The array is the collection of the same type of data- type. To know more about arrays, refer here. What happens when we address an… Read More
Given an array arr[] of size N, where each value represents the number of elements present of the ith type, the task is to find… Read More
Given an array, arr[] of size N, Given M queries and each query consisting of a number X, the task is to subtract X from… Read More
Given an array arr[] of size N having positive elements, the task is to find the minimum number of deletion or append operations to make… Read More
Given an array arr[] of positive integers of size N, the task is to find the minimum possible size of the array that can be… Read More
Given an integer N (N is odd). the task is to construct an array arr[] of size N where 1 ≤ arr[i] ≤ N such… Read More
Given an array arr[] of length N, the task is to check whether the given array forms a valley or not. An array is said… Read More
Given an array arr[] of length N, the task is to find the count of non-overlapping subarrays of size K such that the alternate elements… Read More