forked from mission-peace/interview
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
mission-peace edited this page Jul 21, 2014
·
279 revisions
###Arrays###
- Given two numbers in form of array add them - ArrayAddition.java
- Given stock prices for number of days BuySellStockProfit.java
- Buy sell stock once to maximize profit
- Buy sell stocks any number of times to maximum profit
- Given an array of elements check if elements in the array are consecutive or not. - CheckIfArrayElementsAreConsecutive.java
- Given elements in array divide elements into two groups of closest possible sum Conflict with TugOfWar - DivideNumbersInEqualGroupWithClosestSum.java
- Write a function to determine if array contains duplicate elements within k distance from each other - DuplicateWithinkIndices.java
- Given an array and a number k < n, find all elements occurring more than n by k times - FindElementsOccurringNByKTimesTetris.java
- Given a list of gas stations and amount of fuel they have, find a tour which travels all gas stations - GasStationCircle.java
- Given an unordered array of positive integers, create an algorithm that makes sure no group of integers of size bigger than M have the same integers - GroupElementsInSizeM.java
- Given an array find an increasing subsequence of length 3 which has maximum product - IncreasingSubsequnceOfLength3WithMaxProduct.java
- Given an array find maximum circular contiguous sum - KadaneWrapArray.java
- kth largest element in an unsorted array using quick select - KthElementInArray.java
- kth largest element in two sorted array - KthLargestInTwoSortedArray.java
- Print next greater element for every element in array - LargerElementOnRight.java
- Given an array of 0s and 1s find the largest subarray with equal number of 0s and 1s - LargestSubArrayWithEqual0sAnd1s.java
- Longest increasing subsequence in an array with O(logN) speed - LongestIncreasingSubSequenceOlogNMethod.java
- Given an array maximize i - j such that a[i] > a[j] - MaximumIminusJSuchThatAiGTAj.java
- Given an array, find maximum of all subarrays of size k - MaximumOfSubarrayOfSizeK.java
- Given an array of positive and negative numbers, find a subarray which has maximum product - MaxProductSubarray.java
- Given an array of size n, the array contains numbers in range from 0 to k-1 where k is a positive integer and k <= n. Find the maximum repeating number in this array - MaxRepeatingNumber.java
- Given an array and two numbers, find minimum distance between these numbers. There could duplicates of these numbers in array - MinimumDistanceBetweenTwoNumbers.java
- Find minimum length unsorted subarray, sorting which makes entire array sorted - MinimumSortedWhichSortsEntireArray.java
- Given array of 0 and non zero numbers, move all 0s to the end in O(n) time - MoveAllZerosToEnd.java
- Given an array, return a new array which has multiplication of all elements except own index - MultiplyAllFieldsExceptOwnPosition.java
- Given an unsorted array, find total number of triangles formed taking 3 elements of this array - NumberOfTrianglesInUnsortedArray.java
- Given an array with first negative and then positive numbers, position negative and positive numbers alternately - PositiveAndNegativeNumberAlternatively.java
- Given an array arr[] of size n where every element is in range from 0 to n-1. Rearrange the given array so that arr[i] becomes arr[arr[i]] in O(n) time and O(1) space - RearrangeSuchThatArriBecomesArrArri.java
- Given an array with elements in range of 0 to n-1, one number is repeated and one number is missing. Find both the numbers - RepeatingAndMissingNumber.java
- Stable marriage problem - StableMarriageProblem.java
- Given an unsorted array of nonnegative numbers , find a contiguous subarray with given sum - SubarrayWithGivenSum.java
- Given an array, find triplet which sums to a given value - https://github.com/mission-peace/interview/blob/master/src/com/interview/array/TripletInArray.java 31.Given a set of n integers, divide the set in two subsets of n/2 sizes each such that the difference of the sum of two subsets is as minimum as possible - Conflict with DivideNumbersInEqualGroupWithClosestSum - TugOfWar.java
###Binary Trees### ####Special Tree#### ###LinkList###