## Print all sub sequences of a given array

Objective: Given an array write an algorithm to print all the possible sub subsequences. Example: int [] a = {1, 2, 3}; Output: Possible sub sequences – {Empty}, {1}, {2}, {3}, {1, 2} ,{1,3}, {2,...

@tutorialhorizon

Objective: Given an array write an algorithm to print all the possible sub subsequences. Example: int [] a = {1, 2, 3}; Output: Possible sub sequences – {Empty}, {1}, {2}, {3}, {1, 2} ,{1,3}, {2,...

Objective: Given an array write an algorithm to find the sum of all the possible sub arrays. Example: int [] a = {1, 2, 3}; Output: Possible subarrays – {1}, {2}, {3}, {1, 2} ,...

Objective: Given a list of words and length L. Format the words so that each line will have only L characters and fully justified (left and right justified). Restrictions- You need to fit as many...

Objective: There are n number of eggs and building which has k floors. Write an algorithm to find the minimum number of drops is required to know the floor from which if egg is dropped,...

Objective: Given a printer which can perform only 2 operations- Printer can print consecutive identical characters in one go. It can replace consecutive characters by consecutive identical characters at any position. You are given a...

Objective: Given an array of non negative integers, start from the first element and reach the last by jumping. The jump length can be at most the value at the current position in the array....

Objective: Given a number of boxes with different colors represented by different positive numbers. You need to remove all the boxes in several rounds, each time you can choose continuous boxes with the same color (means...

Objective: Given an array of integers which has all the repeating numbers (twice) but two numbers which are non-repeating. Write an algorithm to find out those two numbers. Example int [] arrA = {4,5,4,5,3,2,9,3,9,8}; Output:...

Objective: Given an array of integers in which all the elements are appear thrice but one which appears only one. Write an algorithm to find that element. Example int [] arrA = {6,5,3,2,4,2,5,6,3,3,6,5,2}; Output: 4...

Objective: Given an array represents cost of a stock on each day. You are allowed to buy and sell the stock only once. Write an algorithm to maximize the profit in single buy and sell....

Objective: The maximum subarray problem is the task of finding the contiguous subarray within a one-dimensional array of numbers which has the largest sum. Example: int [] A = {−2, 1, −3, 4, −1, 2, 1, −5, 4}; Output:...

The algorithm of kMeans is an unsupervised learning algorithm for clustering a set of items into groups. Given a set of multi-dimensional items and a number of clusters, k, we are tasked of categorizing...

This article is contribute by Antonis Maronikolakis Objective: We are given a data set containing items, with numeric values, categorized into classes. We are also given a new item, without a class. We want...

Objective: Given two strings, s1 and s2 and edit operations (given below). Write an algorithm to find minimum number operations required to convert string s1 into s2. Allowed Operations: Insertion – Insert a new...

Objective: In this game, which we will call the coins-in-a-line game, an even number, n, of coins, of various denominations from various countries, are placed in a line. Two players, who we will call...

%d bloggers like this: