Given an array of distinct integers, shuffle an array according to the given order of elements.
Given a set of activities and the starting & finishing time of each activity, find the maximum number of activities that can be performed by a single person assuming that a person can only work on a single activity at a time.
Given an array A of integers, efficiently find a sorted triplet such that A[i] < A[j] < A[k] and 0 < = i < j < k < n where n is the size of the array.
Given an array of integers, find an index that divides the array into two non-empty subarrays having equal sum.
Given a list of jobs where each job has a start and finish time, and also has profit associated with it, find maximum profit subset of non-overlapping jobs.
Given a set of rectangular 3D boxes, create a stack of boxes which is as tall as possible. A box can be placed on top of another box if the dimensions of the 2D base of the lower box are each strictly larger than those of the 2D base of the higher box. Multiple instances …
Given an array of integers, rearrange the array such that it contains positive and negative numbers at alternate positions. If array contains more positive or negative elements, they should be moved to end of the array.
Given an unsorted array of integers whose each element lies in range 0 to n-1 where n is the size of the array, calculate the frequency of all elements present in the array in linear time and using constant space.
Given a positive integer n, print all combination of numbers from 1 to n having sum n.
Given an array of distinct integers, replace each element of the array by its corresponding rank in the array.
Given an unsorted array of integers, print all triplets in it with sum less than or equal to given number.
Given an unsorted array of integers containing many duplicates elements, rearrange the given array such that same element appears together and relative order of first occurrence of each element remains unchanged.