## 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 »

Quick Links for Tree

Quizzes |

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 Search Tree and a number N, the task is to find the smallest number in the binary search tree that is greater… Read More »

Given a BST, the task is to find the sum of all elements greater than and equal to kth largest element. Examples: Input : K… 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 having positive and negative nodes, the task is to find maximum product level in it. Examples: Input : 4 / \… Read More »

Given a binary tree and a node in the binary tree, find Postorder 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 Postorder successor 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 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. Examples: Consider the following binary tree 20… Read More »

Euler tour of tree has been already discussed which flattens the hierarchical structure of tree into array which contains exactly 2*N-1 values. In this post,… 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 »

A Levelwise GCD/LCM alternating segment tree is a segment tree, such that at every level the operations GCD and LCM alternate. In other words at… 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 »