Skip to content

Category Archives: Tree

What is a Binary Tree? A binary tree is a tree data structure with a maximum of 2 children per node. We commonly refer to… Read More
An AVL tree is a self-balancing binary search tree, in which the difference in the heights of the left and right subtrees of any node… Read More
A binary tree is balanced if the height of the tree is O(Log n) where n is the number of nodes. For Example, the AVL… Read More
Given a 2D integer array where each row represents the relation between the nodes (relation[i] = [parenti, childi, isLefti]). The task is to construct the… Read More
Given an Unbalanced binary search tree (BST) of M nodes. The task is to find the N elements in the Unbalanced Binary Search Tree in… Read More
What is a Binary Search Tree? A binary Search Tree is a special type of binary tree data structure that has the following properties:   The… Read More
Given a tree with N node and N-1 edges and an array arr[] where arr[i] denotes the value of ith node, the task is to find… Read More
Given a tree consisting of N nodes where the value of each node is the negative of its node number (i.e., 1st node has a… Read More
Given a BST (Binary Search Tree) with N Nodes, the task is to find the maximum absolute difference between the sibling nodes. Two nodes are… Read More
Given the root of an n-ary tree, the task is to find the number of subtrees that have duplicates in the n-ary tree. Two trees… Read More
What is Heap? A Heap is a special Tree-based data structure in which the tree is a complete binary tree. Types of Heap Data Structure:… Read More
Trees are nonlinear data structures that organize data hierarchically and in a recursive manner.  It is a method of organizing and storing data in the… Read More
Given a tree with N nodes where node 1 is the root, the task is to solve the queries of form {u, k} and find… Read More
Given a perfect binary tree of height N  and an array of length 2N which represents the values of leaf nodes from left to right.… Read More
Given a tree of N nodes numbered from 1 to N and N-1 edges, and an array V[] of length N denoting the value of… Read More

Start Your Coding Journey Now!