Given a binary array, find the index of 0 to be replaced with 1 to get maximum length sequence of continuous ones.
Given an binary array containing 0 and 1, find maximum length sub-array having equal number of 0’s and 1’s.
Given an array of integers, find maximum length sub-array having given sum.
Given an array of integers, check if array contains a sub-array having 0 sum. Also, prints end-points of all such sub-arrays.
Given two sorted arrays X and Y of size m and n each where m >= n and X has exactly n vacant cells, merge elements of Y in their correct position in array X i.e. merge (X, Y) by keeping the sorted order.
Given two sorted arrays X and Y of size m and n each, merge elements of X with elements of array Y by maintaining the sorted order. i.e. fill X with first m smallest elements and fill Y with remaining elements. The conversion should be done in-place and without using any other data structure.
Given an array of integers, move all zeros present in the array to the end. The solution should maintain the relative order of items in the array.
Given an array of integers containing duplicates, return the majority element in an array if present. A majority element appears more than n/2 times where n is the size of the array.
Given an array of integers, find equilibrium index in it.
Given an array of integers, in-place shuffle it. The algorithm should produce an unbiased permutation i.e. every permutation is equally likely.
Given an unsorted array of integers, find a pair with given sum in it .
Given an array containing only 0’s, 1’s and 2’s, sort the array in linear time and using constant space.
Given an binary array, sort it in linear time and constant space. Output should print contain all zeroes followed by all ones.
Given an array of integers, rearrange the array such that every second element of the array is greater than its left and right elements. Assume no duplicate elements are present in the array.