Skip to content

Tag Archives: two-pointer-algorithm

Given an array arr[] of length N, the task is to find the number of non-decreasing sub-arrays of length K.Examples:   Input: arr[] = {1, 2,… Read More
Given an array arr[] of N integers and an integer X, the task is to find three integers in arr[] such that the sum is… Read More
Given a Binary Search Tree, and a number X. The task is to find the number of distinct pairs of distinct nodes in BST with… Read More
Given an array A of size N. The task is to find the length of smallest subarray which contains both maximum and minimum values. Examples: … Read More
Given a Binary Search Tree and a SUM. The task is to check if there exists any triplet(group of 3 elements) in the given BST… Read More
Given a sorted integer array and number k, the task is to count pairs in an array whose product is less than x. Examples: Input:… Read More
Given an array of distinct integers(considering only positive numbers) and a number ‘m’, find the number of triplets with the product equal to ‘m’. Examples:… Read More
Given an array arr[] of positive numbers, find minimum number of sets in array which satisfy following property,  A set can contain maximum two elements… Read More
Given an array of distinct integers and a sum value. Print all triplets with sum smaller than given sum value. Expected Time Complexity is O(n2).… Read More
Given an array of N numbers where a subarray is sorted in descending order and rest of the numbers in the array are in ascending… Read More
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… Read More

Start Your Coding Journey Now!