## 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,...

Skip to content# Category: Google Interview

## Print all sub sequences of a given array

## Print all substrings of a given string

## Dynamic programming – Printer Problem

## Dynamic programming – Minimum Jumps to reach to end

## Find the local minima in a given array

## Print All Diagonals of a given matrix

## Dynamic Programming – Coin In a Line Game Problem

## Dynamic Programming – Split the String into Minimum number of Palindromes.

## Shortest Range in K-sorted Lists

## Dynamic Programming – Minimum Numbers are Required Whose Square Sum is Equal To a Given Number

## Print All Possible Subsets with Sum equal to a given Number

## Dynamic Programming – Subset Sum Problem

## The Word Break Problem

## Backtracking – Knight’s Tour Problem

## Backtracking – N Queens Problem – Better Solution

@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 a string write an algorithm to print all the possible sub strings. Example: String input = “abcd”; Output: Possible sub strings – a a b a b c a b c d b...

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 an array of integer write an algorithm to find the local minima. Local Minima: An element is considered as local minima if it is less than both of its neighbors (if neighbors exist)....

Objective: Given two dimensional matrix, write an algorithm to print all the diagonals of matrix. Example: Approach: We will solve this problem in two parts. first half of diagonals and second half of diagonals....

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...

Objective: You are given a large string. You need to cut the string into chunks such that each substring that you get is a palindrome. Remember that each 1 length string is always a...

Objective: You have k lists of sorted integers. Find the smallest range that includes at least one number from each of the k lists. This is very nice and tricky solution, This problem was asked...

Objective: Given a number, Write an algorithm to find out minimum numbers required whose square is equal to the number. This question has been asked in the Google Interview for Software Developer position.This is...

Objective: Given a number N, Write an algorithm to print all possible subsets with Sum equal to N This question has been asked in the Google for software engineer position. Example: N=4 1111 112...

Objective: Given a set of positive integers, and a value sum S, find out if there exist a subset in array whose sum is equal to given sum S. Example: int[] A = {...

Objective : Given an string and a dictionary of words, find out if the input string can be broken into a space-separated sequence of one or more dictionary words. Example: dictionary = [“I” ,...

Objective : A knight’s tour is a sequence of moves of a knight on a chessboard such that the knight visits every square only once. If the knight ends on a square that is...

Objective : In chess, a queen can move as far as she pleases, horizontally, vertically, or diagonally. A chess board has 8 rows and 8 columns. The standard 8 by 8 Queen’s problem asks...

%d bloggers like this: