Two pointers is really an easy and effective technique which is typically used for searching pairs in a sorted array.Given a sorted array A (sorted in ascending order), having N integers, find if there exists any pair of elements (A[i], A[j]) such that their sum is equal to X....
Given an array and a value, find if there is a triplet in array whose sum is equal to the given value. If there is such a triplet present in array, then print the triplet and return true. Else return false....
Given an array of distinct elements. The task is to find triplets in the array whose sum is zero....
Given two sorted arrays of distinct elements, we need to print those elements from both arrays that are not common. The output should be printed in sorted order. Examples :...
Given two sorted arrays of distinct elements, we need to print those elements from both arrays that are not common. The output should be printed in sorted order. Examples :...
Given an array of integers, you have to find three numbers such that the sum of two elements equals the third element.Examples:...
Given an array of integers, you have to find three numbers such that the sum of two elements equals the third element.Examples:...
Given a binary string S of size N and an integer K, the task is to find the maximum length of consecutive 1s or 0s after flipping at most K characters of the given binary string S....
Two pointers is really an easy and effective technique which is typically used for searching pairs in a sorted array.Given a sorted array A (sorted in ascending order), having N integers, find if there exists any pair of elements (A[i], A[j]) such that their sum is equal to X....
Given an array arr[] of length N, the task is to find the length of the longest subarray which consists of consecutive numbers in increasing order, from the array....
Given an array arr[] consisting of N positive numbers in the range [1, N], the task is to print the array elements which appear even number of times in the given array....
Given an array, write a program to find the sum of array using pointers arithmetic. In this program we make use of * operator . The * (asterisk) operator denotes the value of variable. The * operator at the time of declaration denotes that this is a pointer, otherwise it denotes the value of the memory location pointed by the pointer . sum() function is used to find the sum of the array through pointers....