# Category Archives: Tree

Pre-requisites: Handshaking theorem. Pendant Vertices  Let G be a graph, A vertex v of G is called a pendant vertex if and only if vâ€¦ Read More
Given a Binary Tree, the task is to convert the given Binary Tree to the Symmetric Tree by adding the minimum number of nodes inâ€¦ Read More
Given an array arr[] of size N, the task is to count the number of longest increasing subsequences present in the given array. Example: Input:â€¦ Read More
Given a positive integer K and a weighted undirected connected graph of N nodes and E edges as an array Edges[] of the type {u,â€¦ Read More
AVL Tree is a self-balancing Binary Search Tree (BST) where the difference between heights of left and right subtrees cannot be more than one forâ€¦ Read More
Given a Binary Tree, the task is to find the sum of leaf nodes at every level of the given tree. Examples: Input: Output:0063012Explanation:Level 1:â€¦ Read More
Given a root of the Binary Tree and head of the Linked List, the task is to check if all the elements of the linkedâ€¦ Read More
Given root of the Binary Tree T and a linked list L, the task is to find the direction of path followed from root suchâ€¦ Read More
Given an undirected, connected tree with N nodes valued from 0 to N – 1 and an array edges[][2] represents the edges between two nodes,â€¦ Read More
Given the root node of an N-ary tree and an integer K, the task is to convert the given tree into adjacency list representation andâ€¦ Read More
Given a Binary Search Tree consisting of N distinct nodes, the task is to flatten the given Binary Search Tree to convert the tree intoâ€¦ Read More
Given a group of N people, each having a unique ID value from 0 to (N – 1) and an array arr[] of M elementsâ€¦ Read More
Given a Binary Search Tree, the task is to create a wave array from the given Binary Search Tree. An array arr[0..n-1] is called aâ€¦ Read More
Given two arrays arr1[] and arr2[] of pairs of the form {ID, value} of size N and M respectively and an integer target, the taskâ€¦ Read More
Given a Generic Tree consisting of N nodes valued from 0 to (N – 1) where P[i]th in the array P[] denotes ith nodes parent(1-basedâ€¦ Read More