Skip to content

Category Archives: Tree

Given an integer N, the task is to generate a perfect binary tree with height N such that each node has a value that is… Read More
A 2-3-4 tree is a self-balancing tree. The number represents the number of children each node can have. Any internal node can have either two,… Read More
Given an array arr[] of size M that contains the post-order traversal of a complete N-ary tree, the task is to generate the N-ary tree… Read More
A binary tree is a tree that has at most two children for any of its nodes. There are several types of binary trees. To… Read More
Data structures are an integral part of computers used for the arrangement of data in memory. They are essential and responsible for organizing, processing, accessing,… Read More
A height-balanced binary tree is defined as a binary tree in which the height of the left and the right subtree of any node differ… Read More
Given an undirected tree with N nodes numbered from 1 to N and an array A[] where A[i] denotes the value assigned to (i+1)th node.… Read More
Tree is a non-linear data structure. It consists of nodes and edges. A tree represents data in a hierarchical organization. It is a special type… Read More
Red-Black Tree is one type of self-balancing tree where each node has one extra bit that is often interpreted as colour of the node. This… Read More
Given a Binary tree, the task is to print the outer cone layer i.e. combination of layers formed by moving only through the left child… Read More
Given a tree with N vertices and N-1 edges represented by a 2D array edges[], the task is to find the minimum value among the… Read More
Find the number of leaf nodes in a perfect N-ary tree of height K. Note: As the answer can be very large, return the answer… Read More
We know a tree is a non-linear data structure. It has no limitation on the number of children. A binary tree has a limitation as… Read More
Given a binary tree, a target node and a positive integer K on it,  the task is to find the sum of all nodes within… Read More
Given an N-ary Tree. The task is to print the level order traversal of the tree where each level will be in a new line.… Read More

Start Your Coding Journey Now!