##
Swap Nodes in Binary tree of every k’th level
November 30, 2016

Given a binary tree and integer value k, the task is to swap sibling nodes of every k’th level where k >= 1. Examples: Input… Read More »

November 30, 2016

Given a binary tree and integer value k, the task is to swap sibling nodes of every k’th level where k >= 1. Examples: Input… Read More »

October 27, 2016

Given a Binary Tree find the length of the longest path which comprises of nodes with consecutive values in increasing order. Every node is considered… Read More »

October 9, 2016

Given a binary tree, the task is to flip the binary tree towards right direction that is clockwise. See below examples to see the transformation.… Read More »

September 30, 2016

Given an array arr[0..n-1]. The following operations need to be performed. update(l, r, val) : Add ‘val’ to all the elements in the array from… Read More »

September 25, 2016

September 5, 2016

Given a Binary Tree, convert it to a Circular Doubly Linked List (In-Place). The left and right pointers in nodes are to be used as… Read More »

August 17, 2016

Given a special binary tree whose leaf nodes are connected to form a circular doubly linked list, find its height. For example, 1 / \… Read More »

August 3, 2016

Given an infinite number line from -INFINITY to +INFINITY and we are on zero. We can move n steps either side at each n’th time.… Read More »

August 1, 2016

Given a simple expression tree, consisting of basic binary operators i.e., + , – ,* and / and some integers, evaluate the expression tree. Examples:… Read More »

July 22, 2016

Given a binary tree, print nodes of extreme corners of each level but in alternate order. Example: For above tree, the output can be 1… Read More »

July 3, 2016

Given a binary tree and a node, print all cousins of given node. Note that siblings should not be printed. Example: Input : root of… Read More »

June 26, 2016

Two trees are identical when they have same data and arrangement of data is also same. To identify if two trees are identical, we need… Read More »

June 17, 2016

Given a binary tree, find the largest subtree having identical left and right subtree. Expected complexity is O(n). For example, Input: 50 / \ 10… Read More »

May 26, 2016

Given Postorder and Inorder traversals, construct the tree. Examples: Input : in[] = {2, 1, 3} post[] = {2, 3, 1} Output : Root of… Read More »

May 23, 2016

Given two Binary Trees, write a function that returns true if two trees are mirror of each other, else false. For example, the function should… Read More »