## Find n-th node in Preorder traversal of a Binary Tree

Given a Binary tree and a number N, write a program to find the N-th node in the Preorder traversal of the given Binary tree.… Read More »

- Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2
- Iterative Postorder traversal | Set 3
- Convert a given Binary Tree to Circular Doubly Linked List | Set 2
- K-th ancestor of a node in Binary Tree | Set 3
- Calculate height of Binary Tree using Inorder and Level Order Traversal
- Flatten Binary Tree in order of Level Order Traversal
- Find the largest Complete Subtree in a given Binary Tree
- Count all k-sum paths in a Binary Tree
- Check if the given n-ary tree is a binary tree
- Find the Deepest Node in a Binary Tree Using Queue STL - SET 2
- Find the largest Perfect Subtree in a given Binary Tree
- Get last node of the binary tree following given pattern starting from X
- Sum of the mirror image nodes of a complete binary tree in an inorder way
- Print all the nodes except the leftmost node in every level of the given binary tree
- Maximum sum of leaf nodes among all levels of the given binary tree
- Sum of nodes in the left view of the given binary tree
- Print even positioned nodes of even levels in level order of the given binary tree
- Convert ternary expression to Binary Tree using Stack
- Flatten binary tree in order of post-order traversal
- Find the node whose xor with x gives minimum value
- Queries to find the maximum Xor value between X and the nodes of a given level of a perfect binary tree
- Duplicate subtree in Binary Tree | SET 2
- Find the color of given node in an infinite binary tree
- Maximum sum of non-leaf nodes among all levels of the given binary tree
- Find Maximum Level Sum in Binary Tree using Recursion
- Sum of nodes in the right view of the given binary tree
- Maximum XOR with given value in the path from root to given node in the tree
- Number of ways to divide a Binary tree into two halves
- Flatten Binary Tree in order of Zig Zag traversal
- Delete the last leaf node in a Binary Tree

Given a Binary tree and a number N, write a program to find the N-th node in the Preorder traversal of the given Binary tree.… Read More »

Given a binary tree, the task is to find the distance between two keys in a binary tree, no parent pointers are given. Distance between… Read More »

Given a binary tree and a node in the binary tree, find Preorder predecessor of the given node. Examples: Consider the following binary tree 20… Read More »

Given a binary tree and a node in the binary tree, find preorder successor of the given node. It may be assumed that every node… Read More »

Given a binary tree, the task is to find the distance between two keys in a binary tree, no parent pointers are given. The distance… Read More »

Given a binary tree where each node can have at most two child nodes, the task is to find the Euler tour of the binary… Read More »

The diameter of a tree (sometimes called the width) is the number of nodes on the longest path between two end nodes. In this post,… Read More »

Given a binary tree. Find if a given vertical level of the binary tree is sorted or not. (For the case when two nodes are… Read More »

Given a binary tree, find the vertical width of the binary tree. Width of a binary tree is the number of vertical paths. Examples: Input… Read More »

Given a binary tree, find the vertical width of the binary tree. The width of a binary tree is the number of vertical paths. In… Read More »

Talking about representation, trees can be represented in two way: 1) Dynamic Node Representation (Linked Representation). 2) Array Representation (Sequential Representation). We are going to… Read More »

Given a binary tree in which nodes are numbered from 1 to n. Given a node and a positive integer K. We have to print… Read More »

Given a binary tree and a node, we need to write a program to find inorder successor of this node. Inorder Successor of a node… Read More »

Given Preorder , Inorder and Postorder traversals of some tree. Write a program to check if they all are of the same tree. Examples: Input… Read More »

Given a binary tree, find the sum of all the leaf nodes. Examples: Input : 1 / \ 2 3 / \ / \ 4… Read More »