Skip to content

Tag Archives: array-merge

Given two arrays A[] and B[] consisting of N and M integers respectively, the task is to calculate the maximum prefix sum that can be… Read More
Given an array arr[] consisting of N integers, the task is to count the number of greater elements on the right side of each array… Read More
Given an array A[] of size N (1 ≤ N ≤ 105), the task is to calculate the number of swaps required to sort the… Read More
Given an array arr[] consisting of 2* N elements in the form of { a1, a2, …, aN, b1, b2, …, bN }, the task… Read More
Given two sorted arrays A[] and B[] of size N, the task is to check if it is possible to merge two given sorted arrays… Read More
Implement Merge Sort i.e. standard implementation keeping the sorting algorithm as in-place. In-place means it does not occupy extra memory for merge operation as in standard… Read More
This is an extension of the median of two sorted arrays of equal size problem. Here we handle arrays of unequal size also. Examples: Input:… Read More
Given 2 strings, merge them in an alternate way, i.e. the final string’s first character is the first character of the first string, the second… Read More
Given k sorted arrays of possibly different sizes, merge them and print the sorted output.Examples:   Input: k = 3 arr[][] = { {1, 3}, {2,… Read More
Given two array of size n and m. The task is to find the number of ways we can merge the given arrays into one… Read More
Given two sorted arrays, A and B, where A has a large enough buffer at the end to hold B. Merge B into A in… Read More
Given 3 arrays (A, B, C) which are sorted in ascending order, we are required to merge them together in ascending order and output the… Read More
Given two sorted arrays, the task is to merge them in a sorted manner. Examples: Input : arr1 = [1, 3, 4, 5] arr2 =… Read More
C++ offers in its STL library a merge() which is quite useful to merge sort two containers into a single container. It is defined in… Read More