## 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, PowerSet of any given set S, PS(S) is set of all subsets of S...

Skip to content# Category: Expert

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

## Print All Combinations of subset of size K from Given Array

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

## AVL Tree – Insertion

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

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

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

## Construct a Binary Tree from Given Inorder and Depth-First-Search.

## Inorder Predecessor and Successor in Binary Search Tree

## Rearrange Positive and Negative Elements at Alternate Positions in an Array In O(1) Extra Space

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

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

## Find the Distance between Two Nodes of a Binary Tree.

## Construct a binary tree from given Inorder and Postorder Traversal

## Lowest Common Ancestor in a Binary Tree (Not Binary Search Tree).

@tutorialhorizon

Objective: Given a set of numbers, print all the posssible subsets of it including empty set. Power Set: In mathematics, PowerSet of any given set S, PS(S) is set of all subsets of S...

Objective: Given an array of integers of size N, print all the subsets of size k. (k<=N) Example: Generate all subsets of a fixed size k of a given set [1,2,3…n]. e.g, if n=5...

ObjecÂtive: – Given “n”, generate all valid parenthesis strings of length “2n”. Example: Given n=2 Output: (()) ()() Approach:

What is AVL Tree : AVL tree is widely known as self-balancing binary search tree. It is named after its creator (Georgy Adelson-Velsky and Landis’ tree). In AVL Tree, the heights of child subtrees...

Objective: – Given a inorder and level order traversal, construct a binary tree from that. Input: Inorder and level order traversal Approach: int[] inOrder = { 4, 2, 5, 1, 6, 3, 7 };...

Objective: – Given a preorder traversal, construct BST from that, without using recursion. Input: Preorder traversal Similar Problem : This problem is similar to the Construct Binary Search Tree from a given Preorder Traversal...

Objective: – Given a preorder traversal, construct BST from that. Input: Preorder traversal Similar Problem : This problem is similar to the – Construct Binary Search Tree from a given Preorder Traversal Using Stack...

Objective: – Given a inorder and preÂorder traÂverÂsal, conÂstruct a binary tree from that. Input: Inorder traversal and Depth-First-Search. Approach: int[] inOrder = { 8, 4, 2, 5, 1, 6, 3, 7, 9 }; int[]...

Objective: – Given a Binary Search Tree, Find predecessor and Successor of a given node. What is Predecessor and Successor : When you do the inorder traversal of a binary tree, the neighbors of...

Objective: Given an array arrA[] which has negative and positive elements, rearrange the array in such a manner that positive and negative elements occupy the alternate positions and if there are extra positive or...

Objective: Given an array of size of N and number k. Find all elements in an Array which appears more than N/K times. Input: Array [] and number k. Example: int[] arrA = {...

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.

Objective: – Given nodes in a binary tree, find the distance between them. Example : Approach:

Objective: – Given a inorder and postorder traversal, write an algorithm to construct a binary tree from that. This problem was asked in the Microsoft coding competition. Input: Inorder and postorder traversals Similar Problems:...

Objective: – Find the Lowest Common Ancestor of two given nodes in a Binary Tree What is Lowest Common Ancestor In a given binary tree, The lowest common ancestor of two nodes n1 and...

%d bloggers like this: