Find subarray with given sum | Set 2 (Handles Negative Numbers)
Given an unsorted array of integers, find a subarray which adds to a given number. If there are more than one subarrays with the sum… Read More »
Given an unsorted array of integers, find a subarray which adds to a given number. If there are more than one subarrays with the sum… Read More »
Given k sorted lists of integers of size n each, find the smallest range that includes at least element from each of the k lists.… Read More »
Given an array of distinct elements and a number x, find if there is a pair with a product equal to x. Examples : Input… Read More »
Given an array arr[0..n-1] of distinct elements and a range [low, high], find all numbers that are in range, but not in array. The missing… Read More »
Given Postorder and Inorder traversals, construct the tree. Examples: Input : in[] = {2, 1, 3} post[] = {2, 3, 1} Output : Root of… Read More »
Background : There are three basic operations that must be supported by a hash table (or a dictionary): Lookup(key): return true if key is there… Read More »
Given an m x n matrix, find all common elements present in all rows in O(mn) time and one traversal of matrix. Example: Input: mat[4][5]… Read More »
Every data structure has its own special characteristics for example a BST is used when quick searching of an element (in log(n)) is required. A… Read More »
Given an array of integers, and a number ‘sum’, find the number of pairs of integers in the array whose sum is equal to ‘sum’.… Read More »
Given two arrays which are duplicates of each other except one element, that is one element from one of the array is missing, we need… Read More »
Given an array with n distinct elements, convert the given array to a form where all elements are in range from 0 to n-1. The… Read More »
Given a fraction, find a recurring sequence of digits if exists, otherwise, print “No recurring sequence”.Examples: Input : Numerator = 8, Denominator = 3 Output… Read More »
We have discussed Overview of Array, Linked List, Queue and Stack. In this article following Data Structures are discussed. 5. Binary Tree 6. Binary Search… Read More »
Given an integer, find the most occurring digit in it. If two or more digits occur same number of times, then return the highest of… Read More »
Given an array of integers and a number k, write a function that returns true if given array can be divided into pairs such that… Read More »