# Tag Archives: C++ Array Programs

C++ Array Programs

What is the Determinant of a Matrix? The determinant of a Matrix is a special number that is defined only for square matrices (matrices that have… Read More
Given two sorted arrays, the task is to merge them in a sorted manner.Examples:  Input: arr1[] = { 1, 3, 4, 5}, arr2[] = {2,… Read More
Given an array, the task is to copy these array elements into another array in reverse array.Examples:  Input: array: 1 2 3 4 5 Output:… Read More
Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in the wrong order. This algorithm is… Read More
Write a function rotate(arr[], d, n) that rotates arr[] of size n by d elements.   Rotation of the above array by 2 will make array… Read More
Given an unsorted array of non-negative integers, find a continuous subarray that adds to a given number. Examples :  Input: arr[] = {1, 4, 20, 3,… Read More
Given two N x M matrices. Find a N x M matrix as the sum of given matrices each value at the sum of values of… Read More
Given an array, write functions to find the minimum and maximum elements in it.  Example: C++ // C++ program to find minimum (or maximum) element… Read More
Given a sorted array, the task is to remove the duplicate elements from the array.Examples: Input: arr[] = {2, 2, 2, 2, 2} Output: arr[]… Read More
Given a 2D matrix, the task is to find Trace and Normal of matrix.Normal of a matrix is defined as square root of sum of… Read More
The selection sort algorithm sorts an array by repeatedly finding the minimum element (considering ascending order) from unsorted part and putting it at the beginning.… Read More
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 two matrices, the task to multiply them. Matrices can either be square or rectangular. Examples:  Input : mat1[][] = {{1, 2}, {3, 4}} mat2[][]… Read More
Given a 2D square matrix, find the sum of elements in Principal and Secondary diagonals. For example, consider the following 4 X 4 input matrix. … Read More