Welcome To Tutorialspoint.dev
Officially launched 18th May 2019

# Find three element from different three arrays such that that a + b + c = sum

Given three integer arrays and a &#x201C;sum&#x201D;, the task is to check if there are three elements a, b, c such that a + b + c = sum and a, b and c belong to thre...

# Print all subarrays with 0 sum

Given an array, print all subarrays in the array which has sum 0. Examples: Input: arr = [6, 3, -1, -3, 4, -2, 2, 4, 6, -12, -7] Output: Subarray foun...

# Count subarrays with equal number of 1’s and 0’s

Given an array arr[] of size n containing 0 and 1 only. The problem is to count the subarrays having equal number of 0&#x2019;s and 1&#x2019;s. Examples: Input : arr[...

# Subarrays with distinct elements

Given an array, the task is to calculate the sum of lengths of contiguous subarrays having all elements distinct. Examples: Input : arr[] = {1, 2, 3} Output : 10 {1,...

# Count subarrays having total distinct elements same as original array

Given an array of n integers. Count total number of sub-array having total distinct elements same as that of total distinct elements of original array. Examples: Inp...

# Maximum array from two given arrays keeping order same

Given two same sized arrays A[] and B[] (both arrays contain distinct elements individually but may have some common elements), task is to form a third (or result) ar...

# Count subarrays with same even and odd elements

Given an array of N integers, count number of even-odd subarrays. An even &#x2013; odd subarray is a subarray that contains the same number of even as well as odd int...

# Merge k sorted arrays Set 1

Given k sorted arrays of size n each, merge them and print the sorted output. Example: Input: k = 3, n = 4 arr[][] = { {1, 3, 5, 7}, {2, 4, 6, 8}, ...

# K maximum sum combinations from two arrays

Given two equally sized arrays (A, B) and N (size of both arrays). A sum combination is made by adding one element from array A and another element of array B. Displa...

# Why Quick Sort preferred for Arrays and Merge Sort for Linked Lists?

Why is Quick Sort preferred for arrays? Below are recursive and iterative implementations of Quick Sort and Merge Sort for arrays. Recursive Quick Sort for array. Ite...