Skip to content

Category Archives: Tree

Given a Binary Tree (BT), convert it to a Doubly Linked List (DLL). The left and right pointers in nodes are to be used as… Read More
What is a Perfect Binary Tree? A perfect binary tree is a special type of binary tree in which all the leaf nodes are at… Read More
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
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