##
Connect Nodes at same Level (Level Order Traversal)
August 16, 2017

Write a function to connect all the adjacent nodes at the same level in a binary tree. Example: Input Tree A / \ B C… Read More »

Quick Links for Tree

Quizzes |

August 16, 2017

Write a function to connect all the adjacent nodes at the same level in a binary tree. Example: Input Tree A / \ B C… Read More »

August 15, 2017

Given a Binary Tree and a key, write a function that prints levels of all keys in given binary tree. For example, consider the following… Read More »

August 14, 2017

Given a binary tree, find all duplicate subtrees. For each duplicate subtrees, we only need to return the root node of any one of them.… Read More »

August 11, 2017

Given a binary tree and two nodes. The task is to count the number of turns needs to reach from one node to another node… Read More »

August 10, 2017

Given a tree in form of adjacency list we have to calculate the number of nodes in the subtree of each node, while calculating the… Read More »

August 2, 2017

A leftist tree or leftist heap is a priority queue implemented with a variant of a binary heap. Every node has an s-value (or rank… Read More »

July 27, 2017

Given two n-ary trees, the task is to check if they are mirror of each other or not. Print “Yes” if they are mirror of… Read More »

July 26, 2017

Given an array of elements, our task is to construct a complete binary tree from this array in level order fashion. That is, elements from… Read More »

Given a root of a tree, and an integer k. Print all the nodes which are at k distance from root. For example : Input… Read More »

July 25, 2017

Given a Binary Tree and a key, write a function that returns level of the key. For example, consider the following tree. If the input… Read More »

July 24, 2017

Given two binary trees, we have to check if each of their levels are anagrams of each other or not. Example: Tree 1: Level 0… Read More »

July 22, 2017

In the SET 1 post on TST we have described how to insert and search a node in TST. In this article we will discuss… Read More »

July 17, 2017

Given a perfect binary tree, print nodes of middle level without computing its height. A perfect binary tree is a binary tree in which all… Read More »

Factor Tree is an intuitive method to understand factors of a number. It shows how all the factors are been derived from the number. It… Read More »

Given a binary tree, print all the ancestors of a particular key existing in the tree without using recursion. Here we will be discussing the… Read More »