## Dynamic Programming – Maximum Product Cutting Problem.

Objective: Given a rope of length n meters, write an algorithm to cut the rope in such a way that … Read more

## All N Length Strings from Given String of Length K

Objective: Print All N Length Strings from Given String of Length K where characters can appear multiple time. Example: String … Read more

## Generate Well Ordered Passwords of a Given Length K

Objective: Generate Well Ordered Passwords of a Given Length K. Well ordered means that digits should be in increasing order … Read more

## Print All N Length Strings from Given Number K

Objective: Given Number K, Print all the strings of N length. Example: N = 2, K = 3 [1, 1] … Read more

## Dynamic Programming – Maximum size square sub-matrix with all 1s

Objective: Given a matrix of 0’s and 1’s (binary matrix). Find out the Maximum size square sub-matrix with all 1’s. … Read more

## Dynamic Programming – Longest Increasing Subsequence

Objective: The longest Increasing Subsequence (LIS) problem is to find the length of the longest subsequence in a given array … Read more

## Backtracking – Search a Word In a Matrix

Objective: Given a 2D matrix of characters. Check whether the word exists in the matrix or not. If it exists … Read more

## Dynamic Programming – Minimum Coin Change Problem

Objective: Given an amount of ‘A’ and n coins,   v1<v2<v3<………..<vn. Write a program to find out the minimum number of … Read more

## Find the Deepest Left Node in a Binary Tree.

Objective: – Given a binary tree, Find the deepest left node in it. Approach: This approach is very similar to … Read more

## Find the Deepest Node in a Binary Tree.

Objective: – Given a binary tree, write an algorithm to Find the deepest node in it.

Approach:

• Take two global variables as “deepestlevel” and “value”.
• starting with level=0, Do the inorder traversal and whenever you go down one level ( root.left OR root.right), increase the level by 1.
• Keep checking if deepestlevel < level, if yes then update the “deepestlevel ” and “value “.
• At the end return “value”, which will be the deepest node value.
• See the code for a better explanation.

## Find numbers that are palindrome in the decimal and octal Representations

Objective: Given a range of integers, find all the numbers which are palindrome when they are represented in Decimal Value( base 10) and in Octal value(base 8).

Example :

```Number : 373 (Decimal) and digits are palindrome.

Convert it into Octal which is 565 and that's also palindrome.
```

Approach:

## Find All the Well Ordered Permutations of a Given String.

Objective: Write an algorithm to Print All the Well Ordered Permutations of a Given String.

What is Well Ordered String: When all the alphabets in a string occur in the increasing order irrespective of Lower Case or Upper case.

http://www.careercup.com/question?id=6206517812396032

Example :

```"Sumit" - Not Well Ordered . 'u' occurred after 'S'.

"Now" - Well Ordered. N<o<W.

Input: Interview
Output:
```
[e, e, I, i, n, r, t, v, w] [e, e, i, I, n, r, t, v, w] [e, e, i, I, n, r, t, v, w] [e, e, I, i, n, r, t, v, w]