## Maximum number of leaf nodes that can be visited within the given budget

Given a binary tree and an integer b representing budget. The task is to find the count of maximum number of leaf nodes that can… Read More »

- Construct BST from its given level order traversal | Set-2
- Flatten Binary Tree in order of Level Order Traversal
- Density of Binary Tree using Level Order Traversal
- Maximum sum of leaf nodes among all levels of the given binary tree
- Find the sum of leafs at maximum level
- Print even positioned nodes of even levels in level order of the given binary tree
- Maximum sum of non-leaf nodes among all levels of the given binary tree
- Difference between sums of odd position and even position nodes for each level of a Binary Tree
- Insertion in n-ary tree in given order and Level order traversal

Given a binary tree and an integer b representing budget. The task is to find the count of maximum number of leaf nodes that can… Read More »

Given a binary tree and a node in the binary tree, find Levelorder successor of the given node. That is, the node that appears after… Read More »

Given a binary tree and a node in the binary tree, find Levelorder Predecessor of the given node. That is, the node that appears before… Read More »

Given a tree, with N nodes and E edges (every edge is denoted by two integers, X, Y stating that X is the parent of… Read More »

Top view of a binary tree is the set of nodes visible when the tree is viewed from the top. Given a binary tree, print… Read More »

Given the root of a binary tree and a key x in it, find the distance of the given key from the root node. Distance… Read More »

Given an array of elements, the task is to insert these elements in level order and construct a tree. Input : arr[] = {10, 20,… Read More »

Write a function to print spiral order traversal of a tree. For below tree, function should print 1, 2, 3, 4, 5, 6, 7. Recommended:… Read More »

Given a binary tree and data value of a node. The task is to find the sum of cousin nodes of given node. If given… Read More »

Given a binary tree and a node, print all cousins of given node. Note that siblings should not be printed. Examples: Input : root of… Read More »

Given a root node to a tree, find the sum of all the leaf nodes which are at maximum depth from root node. Example: 1… Read More »

Given a binary tree, flatten it into linked list in-place. Usage of auxiliary data structure is not allowed. After flattening, left of each node should… Read More »

Given a binary tree and the two nodes say ‘a’ and ‘b’, determine whether two given nodes are cousins of each other or not. Two… Read More »

Given a binary tree. The task is to check if the binary tree is sorted level-wise or not. A binary tree is level sorted if… Read More »