## Queries to check if the path between two nodes in a tree is a palindrome

Given a tree with N nodes and N – 1 edges. Each edge of the tree is labeled by a string of lowercase english alphabets.… Read More »

Given a tree with N nodes and N – 1 edges. Each edge of the tree is labeled by a string of lowercase english alphabets.… Read More »

Given three vertices U, V and R of a binary tree, the task is to check whether R lies in the path between U and… Read More »

Given a binary tree, the task is to find the Lowest Common Ancestor of the given two nodes in the tree. Let G be a… Read More »

Given a binary tree and two nodes a and b, the task is to print the minimum and the maximum node value that lies in… Read More »

Given a binary tree and two nodes of that binary tree. Find the sum of all nodes with odd values in the path connecting the… Read More »

Given a binary tree represented as parent array, find Lowest Common Ancestor between two nodes ‘m’ and ‘n’. In the above diagram, LCA of 10… Read More »

Given a binary tree and 3 nodes a, b and c, the task is to find a node in the tree such that after removing… 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, 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 rooted tree, and two nodes which are in the tree, find the Lowest common ancestor of both the nodes. The LCA for two… Read More »

Given a Binary Search Tree and two keys in it. Find the distance between two nodes with given two keys. It may be assumed that… Read More »

Given a binary tree and two nodes, the task is to Print all the nodes that are common for 2 given nodes in a binary… Read More »

Given a binary tree with distinct nodes(no two nodes have the same have data values). The problem is to print the path common to the… Read More »

Prerequisite : Introduction and DFS The task is to find LCA of two given nodes in a tree (not necessarily a Binary Tree). In previous… Read More »

Given an array of N elements and two integers A, B which belongs to the given array. Create a Binary Search Tree by inserting element… Read More »