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
Category Archives: Tree
What is Data Structure: A data structure is a storage that is used to store and organize data. It is a way of arranging data… 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
A binary tree is a type of data structure where each node can only have two offspring at most named as “left” and “right” child.… Read More
Given a binary tree, the task is to print all the nodes of the binary tree in Pre-order, Post-order, and In-order in one iteration. Examples:… Read More
Given a full binary tree where each node value is the same as the minimum value between its children, the task is to find the… Read More