Skip to content

Category Archives: Tree

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
Given a tree with N nodes, an array A[] of size N denoting the value of each node and array edges [][] of size (N-1),… Read More
AVL Trees: AVL tree is a self-balancing binary search tree in which each node maintain an extra factor which is called balance factor whose value… Read More
Given a binary tree and an integer K, the task is to write a program to count the number of nodes such that the path… Read More
What is Segment Tree? A Segment Tree is a data structure that stores information about a range of elements in its nodes. It also allows… Read More
Given a binary tree and a node start that is initially infected. For every second, neighbours of an infected node get infected. The task is… Read More
Trie data structure is defined as a Tree based data structure that is used for storing some collection of strings and performing efficient search operations… Read More
A Data Structure organizes and stores data in a computer so that we can perform operations on the data more efficiently. There are many diverse… Read More

Start Your Coding Journey Now!