Given a positive number N, find all combinations of 2*N elements such that every element from 1 to N appears exactly twice and distance between its two appearances is exactly equal to value of the element.
Write a Java program to print map of India. Below is obfuscated version in Java that generates the map of India.
A Treap Data Structure is basically a combination of a binary search tree and a heap. Binary Search Trees – Deletions and additions of nodes can make the tree unbalanced (heavier on sides, therefore, the property we value about BSTs, the ability to distribute data by equal divisions, goes out of whack). Therefore you’d …
Given a string and a pattern containing wildcard characters i.e. ‘*’ and ‘?’, where ‘?’ can match to any single character in input string and ‘*’ can match to any number of characters including zero characters, design an efficient algorithm to find if the pattern matches with the complete input string or not.
Write an program to reverse a string in Java. For example, reverse of string “Techie Delight” is “thgileD eihceT”.
Given a binary tree, write an efficient algorithm to print binary tree structure in standard output.
The longest increasing subsequence problem is to find a subsequence of a given sequence in which the subsequence’s elements are in sorted order, lowest to highest, and in which the subsequence is as long as possible. This subsequence is not necessarily contiguous, or unique.
Given an array of integers, find sub-array in it that has maximum product of its elements.
Given a list containing future prediction of share prices, find maximum profit that can be earned by buying and selling shares any number of times with constraint that a new transaction can only start after previous transaction is complete. i.e. we can only hold at-most one share at a time.
Find maximum amount of water that can be trapped within given set of bars. Assume width of each bar is 1 unit.
Given a schedule containing arrival and departure time of trains in a station, find minimum number of platforms needed in the station so to avoid any delay in arrival of any train.
Given an array of integers, find the maximum sum of subsequence of given array where subsequence contains no adjacent elements.