## Invert Binary Tree | Recursive and Iterative solution

Given a binary tree, write an efficient algorithm to invert binary tree.

## Longest Increasing Subsequence

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.

## Merging Overlapping Intervals

Given a set of intervals, print all non-overlapping intervals after merging overlapping intervals.

## Decode the given sequence to construct minimum number without repeated digits

Given a sequence consisting of ‘I’ and ‘D’ where ‘I’ denotes increasing sequence and ‘D’ denotes the decreasing sequence. Decode the given sequence to construct minimum number without repeated digits.

## Find ancestors of given node in a Binary Tree

Given a binary tree, find all ancestors of given node in it.

## Inorder Tree Traversal | Iterative & Recursive

Given a binary tree, write iterative and recursive solution to traverse the tree using in-order traversal in C++ and Java.   Unlike linked lists, one-dimensional arrays and other linear data structures, which are traversed in linear order, trees may be traversed in multiple ways in depth-first order (pre-order, in-order, and post-order) or breadth-first order (level …

## Preorder Tree Traversal | Iterative & Recursive

Given a binary tree, write iterative and recursive solution to traverse the tree using pre-order traversal in C++ and Java.     Unlike linked lists, one-dimensional arrays and other linear data structures, which are traversed in linear order, trees may be traversed in multiple ways in depth-first order (pre-order, in-order, and post-order) or breadth-first order …

## Postorder Tree Traversal | Iterative & Recursive

Given a binary tree, write iterative and recursive solution to traverse the tree using post-order traversal in C++ and Java.     Unlike linked lists, one-dimensional arrays and other linear data structures, which are traversed in linear order, trees may be traversed in multiple ways in depth-first order (pre-order, in-order, and post-order) or breadth-first order …

## Reverse Level Order Traversal of Binary Tree

Given a binary tree, print its nodes level by level in reverse order. i.e. all nodes present at last level should be printed first followed by nodes of second-last level and so on.. All nodes for any level should be printed from left to right.

## Check if two binary trees are identical or not | Iterative & Recursive

Write an efficient algorithm to check if two binary trees are identical or not. i.e. if they have identical structure & their contents are also same.     The idea is to traverse both trees and compare value at their root node. If the value matches, we recursively check if left subtree of first tree …

## Reverse text without reversing the individual words

Given a line of text, reverse the text without reversing the individual words.

## Find all binary strings that can be formed from given wildcard pattern

Given a binary pattern that contains ‘?’ wildcard character at few positions, find all possible combinations of binary strings that can be formed by replacing the wildcard character by either 0 or 1.