## 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]

## Find the Increasing Triplet Sub-sequence in an array

Objective: Given an integer array A[1..n], find an instance of i,j,k where 0 < i < j < k <= n and A[i] < A[j] < A[k].

Example :

int

``` arrA[] = { 10, 9, 4, 3, 2, 1, 7, 3, 1, 11, 2, 6, 9 };
Output :
Increasing triplets are

1, 7, 11
1, 2, 6
1, 3, 9

likewise you can find more triplets.
```

Approach:

## Colorful Numbers

Objective: Given a number, find out whether its colorful or not. Colorful Number: When in a given number, product of … Read more

## Print All the Subsets of a Given Set (Power Set)

Objective: Given a set of numbers, print all the posssible subsets of it including empty set. Power Set: In mathematics, … Read more

## Print All Possible Valid Combinations Of Parenthesis of Given ‘N’

Objec­tive: Given “n”, generate all valid parenthesis strings of length “2n”.
Example:

```Given n=2

Output:
(())
()()
```

Approach:

## Implement Queue Using Stacks

Objective: We know that Queue is FIFO (First-in-First-Out) and Stack is LIFO ( Last-in-First-Out). Here our objective is to implement … Read more

## Merge Sort in a Linked list

Objective: Given a Linked List, Sort it using merge sort.Example: ->9->3->4->2->5->1 Sorted List: ->1->2->3->4->5->9 Approach: Reference : Merge Sort in … Read more

## Construct a binary tree from given Inorder and Level Order Traversal

Objective: – Given an inorder and level order traversal, construct a binary tree from that. Input: Inorder and level order … Read more

## Construct Binary Search Tree from a given Preorder Traversal Using Stack (Without Recursion)

Objective: – Given a preorder traversal, construct BST from that, without using recursion. Input: Preorder traversal Similar Problem : This … Read more

## Construct Binary Search Tree from a given Preorder Traversal using Recursion

Objective: – Given a preorder traversal, construct BST from that. Input: Preorder traversal Similar Problem: This problem is similar to … Read more

## Given an array arrA[], find the maximum j – i such that arr[j] > arr[i].

Objective: Given an array arrA[], find the maximum j – i such that arr[j] > arr[i].Example: int[] arrA = { … Read more

## Find All Elements in an Array which appears more than N/K times, N is Array Size and k is a Number.

Objective: Given an array of size of N and number k. Find all elements in an Array which appear more than N/K times.

Input: Array [] and number k.

Example:

```int[] arrA = { 2, 2, 4, 4, 3, 5, 3, 4, 4, 6, 4, 3, 3, 8 };

K = 4

N/k = 14/4 = 3

Output will be [3,4] they appear 5, 4 times respectively.
```

Approach:

## Print All The Nodes Which are X distance from the Given Node

Objective: Given Binary Tree, Print All The Nodes Which are X distance from the Given Node.

Example :

Approach:

Quite Tricky solution, i will explain using the example given in the picture.
Find out all the nodes which are at distance ‘3’ from the given node 5.